I am trying to write a function as a script file. And then put the variables in the function to get output as an array.
That's I am able to do:
function trythis
a = [-2 1 7.5];
ans = myfunction(a)
end
function y = myfunction(x)
y = 1./(x.^2 + 1)
end
However, it shows solution not found. I know how to call the function on the command window but on idea how to make it done all in the script file.
Thanks in advance. Bonnie