How can I send a wrndlg message if the user hasn´t filled an individual cell in a uitable in GUIDE?

1 回表示 (過去 30 日間)
I want to tell the user to go back and fill every cell in the Uitable only if there is an empty cell in a Uitable in Matlab GUIDE. Is the isempty function helpful?

採用された回答

Walter Roberson
Walter Roberson 2016 年 9 月 19 日
data = get(handles.TheUiTableTagName, 'data');
if iscell(data)
if any(cellfun(@isempty, data(:)))
give the warning
else
%nothing is empty
end
else
%uitable data was coded as a numeric array rather than a cell array
%and in numeric arrays, cells are never empty. If some of your columns are not
%intended to be strings, they might have entries that _look_ empty but are not
%actually empty. So.... what do you want to do? Besides making sure that you
%do not accidentally write a numeric array as the uitable data, that is?
end
  3 件のコメント
Walter Roberson
Walter Roberson 2016 年 9 月 19 日
The above code is an appropriate framework.
Alfonso Rodriguez
Alfonso Rodriguez 2016 年 9 月 19 日
Thanks again Walter. Your code did what I expected.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by