Info

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

The expression to the left of the equals sign is not a valid target for an assignment.

3 ビュー (過去 30 日間)
Clare Ferguson
Clare Ferguson 2017 年 9 月 24 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I am very new to MATLAB and am trying to workout the distance between points which have been interpolated in a previous question. The following is what I have entered into MATLAB and am getting an Error saying that 'The expression to the left of the equals sign is not a valid target for an assignment'. I can't see any brackets missing from my functions.
X1 = [0,0;100,140.1235];
d1 = pdist(X1);
X2 = [100,140.1235;200,258.7626];
d2 = pdist(X2);
X3 = [200,258.7626;300,342.3485];
d3 = pdist(X3);
X4 = [300,342.3485;400,425.9343];
d4 = pdist(X4);
X5 = [400,425.9343;500, 509.5202];
d5 = pdist(X5);
X6 = [500,509.5202;558,558];
d6 = pdist(X6);
Total_Length = d1+d2+d3+d4+d5+d6
  3 件のコメント
KSSV
KSSV 2017 年 9 月 24 日
Why don't you specify the line number of error?
Image Analyst
Image Analyst 2017 年 9 月 24 日
Please copy and paste ALL THE RED TEXT that you see. this will include the line number, the actual line of code that threw the error, and the actual error message. http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer

回答 (1 件)

Niraj Gadakari
Niraj Gadakari 2017 年 9 月 26 日
編集済み: Niraj Gadakari 2017 年 9 月 26 日
The given code works fine when I executed. I suggest clearing variables in your workspace and try to execute the code. Type the following command in the Command Window and then execute the code: >> clear

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by