Why am I getting an error "vectors must be the same length"
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kaylene Widdoes
le 10 Sep 2015
Modifié(e) : Thorsten
le 10 Sep 2015
I am trying to call an anonymous function to graph, one graph using 1 resolution, the other using .01 resolution. I keep getting a "vectors must be the same length" error when running.
f=@(x) ((exp(x)).*(sin(x)))./((x.^2)+1);
x = 3:1:7; x1 = 3:.01:7;
plot(x,f(x),x1,f(x))
0 commentaires
Réponse acceptée
Plus de réponses (2)
Michael
le 10 Sep 2015
Is there a typing error? Did u mean plot(x,f(x),x1,f(x1<---))?
Just use
figure(1);
plot(x,f(x));
figure(2);
plot(x1,f(x1));
0 commentaires
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!