The expression to the left of the equals sign is not a valid target for an assignment.
Re: The expression to the left of the equals sign is not a valid target for an assignment.
This error happens in MATLAB, when the left side of an equation or command can not save the result of a command.
for example :
sum2 = 10
in3 = [2,3]
if( y = in3 )
sum_y = sum2 +1;
end
In the top m-file, there is error in the if-command.
The in3 variable is a matrix, but the y variable is a number, so this line of the program produces an error.
Solution :
sum2 = 10
in3 = [3]
if( y == in3 )
sum_y = sum2 +1;
end
for example :
sum2 = 10
in3 = [2,3]
if( y = in3 )
sum_y = sum2 +1;
end
In the top m-file, there is error in the if-command.
The in3 variable is a matrix, but the y variable is a number, so this line of the program produces an error.
Solution :
sum2 = 10
in3 = [3]
if( y == in3 )
sum_y = sum2 +1;
end
Who is online
Users browsing this forum: No registered users and 15 guests