So I have to draw some graphs in MatLab.
At first I save this as a .m file:
function y = f(x)
y = sqrt((abs(sin(21*pi*x)))/(2+sin(20*pi*x)));
Then I do:
x=[0:0.05:1]
y=f(x)
and then when I need to draw the graph, using
plot(x,f)
I get this error:
??? Input argument "x" is undefined.
Error in ==> f at 2
y = sqrt((abs(sin(21*pi*x)))/(2+sin(20*pi*x)));
Can someone tell me what is the problem here?
