Figure set color error
이전 댓글 표시
Hi,
I get this very annoying error which just blocks me :
figure; set(gcf,'color','w'); ??? Index exceeds matrix dimensions.
wtf ?! Setting color works when I start Matlab. Then, when I try doing it in a script. I get this error. And this error then just happens all the time even if I just type the above in the command window with a new figure.
I am running Matlab 2011a on MacOSX 10.7.3. Please help, it is urgent. I need my data to be plotted properly for an upcoming conference and this stupid error just blocks my whole progress.
Thanks a lot for any help.
채택된 답변
추가 답변 (3개)
Jan
2012년 5월 21일
I think it is the scalar variable called "set", which stops your program from working correctly. See:
which set -all
It is recommended not to shadow built-in function by variables to avoid such unexpected problems. But such problems appear frequently in this forum, such that accidental shadowing cannot be called "unexpected" actually. Therefore I'd even dare to claim, that the forum is powerful enough to fix this problem.
Another idea is the standard procedure:
dbstop if error
Then Matlab stops when the error occurs. Then "whos" reveal the current variables and splitting the command into parts and run them in the command line reveals the underlying problem soon.
Yves
2012년 5월 21일
0 개 추천
댓글 수: 1
Andreas Goser
2012년 5월 21일
GCF overlay was just an example. This also can be FIGURE, SET and sometimes even stuff that is used in called functiions.
카테고리
도움말 센터 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!