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
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

Thanks for pointing that out. I still keep getting this error message everytime I run it. new thing.jpg
Jan
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.
hi,
Actually when try to run it now, this code pops up:
Undefined function or variable 'gui_mainfcn'.
Error in demo2 (line 42)
gui_mainfcn(gui_State, varargin{:});
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에 대해 자세히 알아보기

태그

질문:

2019년 7월 16일

댓글:

2019년 7월 16일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by