MATLAB: Alter popupmenu to edit textbox in GUI

matlab gui

In GUI design, I want to use this statement to alter the components in GUI:
if num=0
set(handles.item,'Sytle','edit');
end
Hence, I can change popupmenu to edit textbox if no items are available in popupmenu.But it doesn't work.
Could anyone tell me correct way to do so?
Thanks 🙂

Best Answer

Do you want "Style" instead of "Sytle"? What does "it doesn't work" explicitly mean? Do you get an error message or does the result differ from your expectations?
It would be helpful, if you post the relevant code - btw, only the relevant code, while "if num=0" is confusing only here. Btw. it must be "if num==0": "=" assigns a variable, while "==" compares them.
[EDITED after tony's comment:]
What do you expect "handle" to be? Perhaps you have defined it earlier in the code by:
handles = guidata(hObject)
and forgot the trailing "s"?