Problem with ''if''

1 次查看(过去 30 天)
alexis
alexis 2011-7-20
Hi everyone, I have this variable:
values =
[] [1x27 char] [1x32 char] [1x28 char] [1x34 char]
and i want have a check for empty cells. I use :
if values[ ]==[ ]
....
end
But unfortunately....
??? Conversion to logical from cell is not possible. What can i do???

采纳的回答

Robert Cumming
Robert Cumming 2011-7-20
cellfun ( @isempty, values )
  5 个评论
Oleg Komarov
Oleg Komarov 2011-7-20
idx = cellfun('isempty',values);
find(~idx,1,'first')
Finds the location of the first non-empty.
alexis
alexis 2011-7-21
Thank you!!!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by