Hi all,
I'm very very new to Matlab and I tried to attempt at making a simple iteration script. Basically all I wanted to do was plot:
1*sin(x)
2*sin(x)
3*sin(x)
...
4*sin(x)
And this is the program that I wrote:
function test1
x=1:0.1:10;
for k=1:1:5;
y=k*sin(x);
plot(x,y);
end % /for-loop
end % /test1
However, it only plots y=5*sin(x) or whatever the last number is...
Any ideas?
Thanks! Amit