MATLAB Answers

pink
0

warning dialog

Asked by pink
on 18 Jun 2011
I want to use the data below for the logic
Data =
'' ''
'' ''
'' ''
'' ''
if %Data
warndlg('warningstring')
else
end

  0 Comments

Sign in to comment.

Tags

1 Answer

Image Analyst
Answer by Image Analyst
on 18 Jun 2011
 Accepted Answer

Look up isempty(). And you probably want to wrap your warndlg inside a uiwait(). If it's like msgbox(), it will continue with your code, blasting right past that warning message unless you put it inside a uiwait().

  9 Comments

pink
on 19 Jun 2011
hi walter
after I use if ~iscell(data) || all(cellfun(@isempty,data(:))),
all data read is empty, I would like if uitable1 filled figures (not empty) then the variable 'data' is used in further calculations
Walter Roberson
on 19 Jun 2011
I will need to do some testing to see when it is possible for the data to not be a cell array when it is retrieved. Unfortunately that is not something I can test from home with my current configuration.
I do not think you should be testing for the emptiness of the cells in the cell-clicked callback: if the user is editing a series of the cells, they are not going to want the calculations to take place until they are finished editing.
If you have the data and it _is_ a cell array and you want to ensure that there is something in each of the cells, then
any(cellfun(@isempty,data(:)))
will be true if there are any empty cells.
pink
on 19 Jun 2011
thanks walter..

Sign in to comment.