MATLAB Answers

scott
0

Matlab Error, variable, to the left of equals sign

Asked by scott
on 12 Dec 2012
I am assigning a variable in a for loop within a elseif statement and its I have
??? Error: File: Finally.m Line: 223 Column: 9
The expression to the left of the equals sign is not a valid
target for an assignment.
when I am just assigning a variable to a number....

  1 Comment

Post the part of code which causes error

Sign in to comment.

1 Answer

Answer by Dr. Seis
on 12 Dec 2012

You said you are "just assigning a variable to a number." You mean like this:
>> a = 2
a =
2
>> 3 = a
??? 3 = a
|
Error: The expression to the left of the equals sign is not a valid target for an assignment.
This is not allowed.

  0 Comments

Sign in to comment.