For loop invalid syntax problem, very frustrating.
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Roger Stafford
2015 年 4 月 14 日
Put an asterisk between the 0.032 and the 't':
Htheo(t)=4*(1-exp(-0.032*t))
0 件のコメント
Star Strider
2015 年 4 月 14 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!