MATLAB Answers

error for equality of default

4 ビュー (過去 30 日間)
helia rasouli
helia rasouli 2019 年 8 月 26 日
コメント済み: Ted Shultz 2019 年 8 月 26 日
i have this error:
Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.
line: 12946
but in that line, there is just code of matlab which i can not edit it :
% Component initialization
methods (Access = private)
how can i solve it?

  1 件のコメント

Ted Shultz
Ted Shultz 2019 年 8 月 26 日
That line looks fine. I suspect an error above that in your code? for this type of error, I find the "smart indent" feature useful. In particular look for a missing "end", ), ] , ect.

Sign in to comment.

採用された回答

Ted Shultz
Ted Shultz 2019 年 8 月 26 日
Look at your code above this line for the true error.

  2 件のコメント

helia rasouli
helia rasouli 2019 年 8 月 26 日
thank you for your answer
this is picture of error
Ted Shultz
Ted Shultz 2019 年 8 月 26 日
Based on that image, look way up near the top. All those orange bars on the right side of your screen imply something weird is going on. Look around when they start. You can mouse over them to get a line number.

Sign in to comment.

その他の回答 (1 件)

Steven Lord
Steven Lord 2019 年 8 月 26 日
My guess is that you have too many end keywords in your code (or perhaps too few.) Smart indent your code (see the Code View Shortcuts section on that page) and check where the last few end keywords in your code block are aligned. If I'm right, MATLAB is confused about how to interpret the line where the automatically provided code is trying to start a methods block and that is its best guess about the cause of its confusion.

  0 件のコメント

Sign in to comment.

タグ


Translated by