getting an error while using rest slice viewer ??

Error using sprintf Function is not defined for 'matlab.ui.Figure' inputs.
Error in rest_sliceviewer>InitControls (line 940) set(theFig, 'DeleteFcn', sprintf('rest_sliceviewer(''Delete'', %g);', theFig) );
Error in rest_sliceviewer (line 74) REST_SliceViewer_Cfg.Config(1+GetDisplayCount(REST_SliceViewer_Cfg)) =InitControls(AFilename, ACallback);
Error in rest_sliceviewer (line 38) rest_sliceviewer('ShowImage',''); %by Default, I show a black brain image
Error in rest (line 153) rest_sliceviewer,
Error using drawnow Error while evaluating UIControl Callback

Respuestas (1)

Rik
Rik el 2 de En. de 2018
Editada: Rik el 2 de En. de 2018
Apparently rest slice viewer was made for HG1 releases (which have numerical handles), and so is not compatible with HG2 releases (R2014b and newer).
This specific instance can be fixed by explicitly loading the number (which might have been turned off)
set(theFig, 'DeleteFcn', sprintf('rest_sliceviewer(''Delete'', %g);', get(theFig,'Number')) );
Edit: this change will keep the code compatible with prior releases, although there may be many other things you will have to change.

2 comentarios

pra sa
pra sa el 2 de En. de 2018
Thanks..but still it shows the same error
Rik
Rik el 2 de En. de 2018
Really? Does it still say "Error using sprintf Function is not defined for 'matlab.ui.Figure' inputs." for this same line? I don't understand that, because it doesn't use the figure object as an argument for sprintf anymore. Have you close all instances of this function before retrying?

Iniciar sesión para comentar.

Categorías

Preguntada:

el 2 de En. de 2018

Comentada:

Rik
el 2 de En. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by