For loop invalid syntax problem, very frustrating.
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I keep getting the error: "invalid syntax at 't' possibly a ),},or] is missing" I seriously have tried everything I can think of to fix this, but nothing works. help please.
for t = 1:250
Htheo(t)=4*(1-exp(-0.032t))
end
0 commentaires
Réponses (2)
Roger Stafford
le 14 Avr 2015
Put an asterisk between the 0.032 and the 't':
Htheo(t)=4*(1-exp(-0.032*t))
0 commentaires
Star Strider
le 14 Avr 2015
You’re missing a multiplication operator ‘*’. MATLAB doesn’t assume multiplication if no operator is stated.
This works:
for t = 1:250;
Htheo(t)=4*(1-exp(-0.032*t));
end
0 commentaires
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!