Writing cos functions with two variables in MATLAB
Date: 2022-12-19 11:51:09
How do I write the following function in MATLAB:
f(x)=cos h (x^2)
I have been trying this:
function y=f01(x,h) y=cos(h).(x.^2); function y=f01(x,h) y=cos(h)*(x.^2);7 function y=f01(x,h) y=cos(h)(x.^2);
And many more instances. Nothing works. I can't find similar examples in the cos function documentation.
Answer:
I found out that the equation can be written as follows:
function y=f01(x,h) y=cos(h*(x.^2));