필터 지우기
필터 지우기

Error Message in uitable GUI

조회 수: 4 (최근 30일)
laurie
laurie 2015년 3월 19일
댓글: Adam 2015년 3월 19일
I have a editable uitable in a GUI. How can I check the user input data, and if the values are negative, display an error message?

답변 (1개)

Adam
Adam 2015년 3월 19일
There's a CellEditCallback in which you can add whatever code you want in response to someone entering something in a cell of the table.
  댓글 수: 2
laurie
laurie 2015년 3월 19일
if any((data(:,1)) < 0)==1
warndlg('Must be greater than zero.','Warning!')
end
Where (data(:,1)) is column 1 of my uitable
I get the error:
Undefined function 'lt' for input arguments of type 'cell'.
Adam
Adam 2015년 3월 19일
Isn't 'data' a cell array from a uitable? In which case you need to apply cell operations or convert to a numerical array if it is pure numbers

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

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by