GUI help in calling an if elseif else function
显示 更早的评论
Hi all,
I am trying to call out this if elseif else function in the GUI. So basically, the "what case box" represent the casenum, and the empty static box should call out a msg when "what case box" has a value.


回答(1 个)
Walter Roberson
2019-7-16
0 个投票
Use the Callback property of the edit box to trigger the action. Remember that the edit box will be char (or cell array of char if Max>1 for the edit box) so you will need to str2double.
Note: you should not have any condition on the "else".
4 个评论
Aser Zidan
2019-7-16
Jan
2019-7-16
Please post the text as text and not as screenshot. Thanks.
The posted screenshot shows only a part of the error message. We need the full message instead.
After you have defined condition=str2double(...) you overwrite its value in the if block.
Aser Zidan
2019-7-16
Walter Roberson
2019-7-16
What is the result you expect from
str2double(set(handles.output, 'string'))
? Notice that is a set() call, not a get() call.
类别
在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
