How to figure out if an array is ordinary or cell?
1 次查看(过去 30 天)
显示 更早的评论
采纳的回答
bio lim
2015-7-7
编辑:bio lim
2015-7-8
tf = iscell(A);
if tf == 1
A =cell2mat(A)
end
2 个评论
Steven Lord
2015-7-7
Two comments:
- You don't need to use == 1 here.
- You need to return an output argument from CELL2MAT, otherwise you're making a matrix from the cell array then throwing that matrix away.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!