Change message in static text in a gui -loop
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Image Analyst
2015-7-7
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.
2 个评论
Image Analyst
2015-7-8
You probably did not give the "tag" property of your static text label. Put
handles
right before the set() call, and see what values it lists for handles. Your static text label should be one of the names listed.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!