Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How do fix errors like this - "The expression to the left of the equals sign is not a valid target for an assignment.". The code is given below which is showing the mentioned error when executed.

1 回表示 (過去 30 日間)
saikrishna gadde
saikrishna gadde 2015 年 4 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
rSV^(3) = (y(1)^(2)+y(2)^(2)+y(3)^(2))^(3/2);

回答 (2 件)

Mahdiyar
Mahdiyar 2015 年 4 月 8 日
Hi
Please give us the matrixes or mention their dimension.
Regards,

Michael Haderlein
Michael Haderlein 2015 年 4 月 8 日
The error description is pretty clear, on the left hand side you have something you cannot assign a value to. The left hand side must be operator-free, so, the power operator is the problem here. If you want the third power of rSV to be equal to the right hand side, you need to take the third root of the equation, thus,
rSV= (y(1)^(2)+y(2)^(2)+y(3)^(2))^(1/2);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by