Hello, I am trying that this function below accepts vector inputs, but it doesnt want to work.
function y = myfunction(x)
y=x*(exp(x*(-0.7)))*sqrt(2*x^2+1)
end
I tried to replace the x* with x.*, but it wont work either. Maybe I am calling it wrong? myfunction(5) works, but myfunction([5 2]) does not.
Thanks in advance!
1 Comment
Tim (view profile)
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/387743-make-a-function-accept-vector#comment_544467
Sign in to comment.