Encoundered error during compiling program for solving differential equation ode45 using MATLAB R2013a.
조회 수: 2 (최근 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개)
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!