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!