Problem with ''if''
1 次查看(过去 30 天)
显示 更早的评论
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???
0 个评论
采纳的回答
Robert Cumming
2011-7-20
cellfun ( @isempty, values )
5 个评论
Oleg Komarov
2011-7-20
idx = cellfun('isempty',values);
find(~idx,1,'first')
Finds the location of the first non-empty.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!