When using linspace, matlab shows an error message= not enough input arguments.
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Carey Huang
le 23 Jan 2017
Commenté : Star Strider
le 23 Jan 2017
for i=1:20
y=log(cond(vander(linspace(1,0,n))));
plot(n,y,'-');hold on
end
There is no line shown up.
Error message:
Not enough input arguments.
Error in linspace (line 19)
n = floor(double(n));
Help! Thanks in advance!
0 commentaires
Réponse acceptée
Star Strider
le 23 Jan 2017
Modifié(e) : Star Strider
le 23 Jan 2017
I do not see where you defined ‘n’.
This works for me:
for n=1:20
y=log(cond(vander(linspace(1,0,n))));
plot(n,y,'pg');
hold on
end
EDIT —
Also:
i = 1:20;
for n = i
y(n)=log(cond(vander(linspace(1,0,n))));
end
figure(1)
plot(i,y,'-pg');
grid
2 commentaires
Plus de réponses (1)
Walter Roberson
le 23 Jan 2017
You would get that argument if you had defined n as being an input argument to your function, but the place that called your function did not pass in a value in the position that corresponds to n.
0 commentaires
Voir également
Catégories
En savoir plus sur Logical 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!