Detecting an empty uitable

Hello,
I am developing a GUI which has several editable tables that correspond to optional parameters. I'm looking for a way to detect if the user has left the table empty. I tried using something like this:
data=get(handles.TestTable,'Data');
if data
disp('data is here')
else
disp('no data found')
end
But this gave the error 'Conversion to logical from cell is not possible.' Any help on how to handle this would be much appreciated.

 채택된 답변

Walter Roberson
Walter Roberson 2012년 7월 10일

0 개 추천

if all(cellfun(@isempty, data(:)))

추가 답변 (1개)

John
John 2012년 7월 10일

0 개 추천

try the command "isempty"
for example:
if isempty(data) == 0
disp('data is here')
else
disp('data is not here')
end

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

질문:

2012년 7월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by