Does EXIST work in GUIDE (GUI)
Mostrar comentarios más antiguos
Hello, I have a little problem with EXIST function. I'm having a button with some calculations in code but later in code there is modification button(that asignin to workspace some other values). I've tride simple IF function (if exist modified value in workspace then do something else). But It does not work
if exist('N1pg','var')==0
....
else
...
end
if(get(handles.radiobutton10,'Value'))== (get(handles.radiobutton10,'Max'))
N1pg=str2num(get(handles.edit86,'String'));
assignin('base','N1pg',N1pg);
Thank you for solution\fix.
Respuesta aceptada
Más respuestas (3)
Paulo Silva
el 11 de Jul. de 2011
Inside your GUI or any function:
e=evalin('base','who'); %get all the variables names present in the workspace
if ismember('N1pg',e) %check if your variable is one of them
%is one of them, do something
else
%the variable isn't in the workspace yet, do something else
end
Lex
el 11 de Jul. de 2011
0 votos
Lex
el 11 de Jul. de 2011
0 votos
Categorías
Más información sobre Whos 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!