Error: Why does Matlab keep on saying this?
古いコメントを表示
As part of an exercise, I wrote the following code:
%define colors for each face
myred = [1, 0, 0];
mygreen = [0, 1, 0];
myblue = [0, 0, 1];
myyellow = [1, 1, 0];
mycyan = [0, 1, 1];
patchcolors = [...
myred;... %front
mygreen;... %back
myblue;... %right
myyellow;... %left
mycyan;... %top
mycyan;... %bottom
];
For the line starting with myred =...., the command window says:
" The expression to the left of the equals sign is not a valid target for an assignment."
The editor shows this:

If I hover my cursor over the highlighted errors, this is what I get:



I don't see what is obviously wrong with the code. In fact, if I write the exact same line under that first line (myred=....), Matlab seems to find no error in it.
Advice? Suggestions?
3 件のコメント
Dennis
2018 年 9 月 6 日
What are the lines above the shown code?
Guillaume
2018 年 9 月 6 日
Most likely you're missing a closing ), } or ] on a line before the error. Post (or attach) your whole code.
Mahmud Khan
2018 年 9 月 6 日
編集済み: Mahmud Khan
2018 年 9 月 6 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Assembly についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!