i got an error when i run this code ?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponse acceptée
Andrei Bobrov
le 14 Mar 2013
Modifié(e) : Andrei Bobrov
le 14 Mar 2013
k = 1:5;
x = 1:100;
y = k'*log(x);
plot(x,y);
2 commentaires
Plus de réponses (1)
Wayne King
le 14 Mar 2013
Modifié(e) : Wayne King
le 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)
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!