i got an error when i run this code ?
Show older comments
x=(1:100); for k=1:5 y(:,k)=k*log(x); end plot(x,y)
the error is in the third line? i want to make a single plot for different values of k
Accepted Answer
More Answers (1)
Wayne King
on 14 Mar 2013
Edited: Wayne King
on 14 Mar 2013
x=(1:100); for k=1:5 y(:,k)=k*log(x); end, plot(x,y)
You forgot a semicolon, or comma after end
or better yet:
x=(1:100);
for k=1:5
y(:,k)=k*log(x);
end
plot(x,y)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!