If statement error code mistake - string input too long not working...
조회 수: 1 (최근 30일)
이전 댓글 표시
I essentially have this as code in the GUIDE GUI pushbutton1_Callback. Error Code II is not working properly. Even if I enter in say "Bob" in the empty textbox and push the button, its giving me Error Code II (the elseif statement). What's the issue here? Input would be greatly appreciated.
if isempty(editString)
errordlg('Please enter a name into the text-box. ...','ErrorCode I');
return
elseif char(editString) > 12
errordlg('Please enter a name with less than 12 characters. ', ...
'Error Code II');
else
delete(gcf)
gui_02
end
댓글 수: 0
답변 (1개)
per isakson
2014년 12월 18일
편집: per isakson
2014년 12월 18일
elseif char(editString) > 12
I guess your intention is
elseif length(editString) > 12
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!