how to find out number of rows in particular matrix of the cell?
2 次查看(过去 30 天)
显示 更早的评论
Suppose i have 1*2 cell as shown below
A B
[1 2] [1 2 ; 3 4]
how can i find out number of rows in each cell..in these example they are 1 and rsply. for A and B.
0 个评论
采纳的回答
更多回答(1 个)
Azzi Abdelmalek
2013-7-15
out=cellfun(@(x) size(x,1),a)
4 个评论
Azzi Abdelmalek
2013-7-15
Sorry, my connection is very bad, I did not see your answer, I will remove mine
Evan
2013-7-15
编辑:Evan
2013-7-15
No worries, I often have the same problem. I just made that comment in order to clarify the difference between our answers (and to give you guys a chance to correct me in case I was mistaken :P). It wouldn't hurt to leave it up in order to have an example of how to use anonymous function handles with cellfun, especially since the list of available string arguments is pretty short and you oftentimes have to resort to function handles. I just wanted to clarify that, when available, the string arguments were best.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!