Encoundered error during compiling program for solving differential equation ode45 using MATLAB R2013a.
1 回表示 (過去 30 日間)
古いコメントを表示
Came across 'The expression to the left of the equals sign is not a valid target for an assignment' during compiling ode45 differential equation solver line 29, what would be the possible error.
0 件のコメント
回答 (2 件)
Torsten
2016 年 6 月 2 日
if s==0
u=b*x(2)+c*x(1)-3*(1+abs(x(2)))*sign(s);
end
Best wishes
Torsten.
0 件のコメント
Steven Lord
2016 年 6 月 2 日
I believe line 29 is:
if s=0;
A single equal sign performs assignment. Two equal signs performs comparison.
x = 5; % Assign the value 5 to x
x == 5 % Returns true if x is equal to 5 and false if it is not.
The if keyword wants a comparison, not an assignment, as its condition.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!