필터 지우기
필터 지우기

Matlab GUI - Error check and message accordingly

조회 수: 3 (최근 30일)
Vineet Guru
Vineet Guru 2013년 6월 4일
I have seen several videos on GUIs showing how to do this but when I attempted it, the error display box (tag = msg) does not display an error if anything other than numeric values are inserted into the boxes.
I'll be delighted if someone can help me with this.
I have uploaded the code here from where it can be downloaded.
The files you will need are the m file, the fig file and the .xlsx file
Thank You

채택된 답변

Image Analyst
Image Analyst 2013년 6월 4일
You could use a try/catch like this:
try
% Some code that might generate an error.
catch ME
errorMessage = sprintf('Error in function blah_blah_blah().\n\nError Message:\n%s', ME.message);
fprintf(1, '%s\n', errorMessage);
uiwait(warndlg(errorMessage));
end
  댓글 수: 1
Vineet Guru
Vineet Guru 2013년 6월 5일
Thanks Image Analyst. I'll attempt your solution.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by