Figure set color error
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (3)
Jan
el 21 de Mayo de 2012
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
el 21 de Mayo de 2012
0 votos
1 comentario
Andreas Goser
el 21 de Mayo de 2012
GCF overlay was just an example. This also can be FIGURE, SET and sometimes even stuff that is used in called functiions.
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!