Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
how to fix invalid first data argument
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
n=1;
for ii=1:0.5:9
t(n)=ii;
if ii>=0
y(n)=-3*ii.^2+5;
n=n+1;
elseif ii<0
y(n)=3*ii.^2+5;
n=n+1;
end
end
plot(t,y)
0 commentaires
Réponses (1)
Star Strider
le 17 Août 2019
Your code runs without error for me.
Note that in your code ‘ii’ is never going to be less than 0, so the entire if block is not necessary.
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!