MATLAB: Change message in static text in a gui -loop

changeguiloopstaticstatictexttext;update

Hi guys,
I am having some trouble changing a static text in a gui. I have a loop and a message that changes along that loop.
I want the message in the static text to change with it.
I have tried using set() but it isn't working…
For example:
If x=2
d='True';
else
d='False';
end
set(handles.statictext,'String',d);
Can anyone help?
Thanks in advance!
InĂªs

Best Answer

Use double equals and not equals. Also use if not If, and use drawnow. Try it like this:
if x==2 % Use == not =
d='True';
else
d='False';
end
set(handles.statictext,'String',d);
drawnow; % Force immediate update.