Watch out! Martix size!
This works in Matlab but not here? It fails on Test 3, but when I use the same value of x and the same function in Matlab it works...
Your output y is a row vector (or scalar), but in 3'rd test it should be a column vector. Predefine y first with the same size as x.
good solution
1629 Solvers
Matrix indexing with two vectors of indices
498 Solvers
Are all the three given point in the same line?
280 Solvers
Rotate input square matrix 90 degrees CCW without rot90
392 Solvers
445 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!