UISTACK doesn't recognize handle

4 Ansichten (letzte 30 Tage)
Trevor Fields
Trevor Fields am 12 Jun. 2018
Beantwortet: Adam am 12 Jun. 2018
I'm using uistack to reorder elements on an axes generated using GUIDE. I receive the error:
Error using ==> get
Invalid handle
Error in ==> uistack at 61
Parent=get(Handles,{'Parent'});
My code is:
axes(handles.axes1);
imagesc(output_image); % Plot image
uistack(output_image, 'bottom');
I tried to put in if statements to check if it is necessary to run the function, and I've tried various renamings of the output_image. Any help is much appreciated, thank you!
  1 Kommentar
Dennis
Dennis am 12 Jun. 2018
try to pass your axes handle instead of the name of your imagedata.
uistack(handles.axes1,'bottom')

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Adam
Adam am 12 Jun. 2018
hImage = imagesc(output_image); % Plot image
uistack( hImage, 'bottom');
You need to keep the graphics handle output of the imagesc function and pass that to uistack. You are just passing raw data that has nothing to do with any graphics object itself.

Weitere Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by