Calling multiple cell elements at once
3 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a cell something like
A=
[1x3 double] [1x3 double] [1x3 double] [1x3 double]
Is it possible to call the first position of each vector at once? Something like
A{:}(1)
2 个评论
Matt J
2012-11-17
Since your A{i} are all the same size and numeric type, it is puzzling why you would maintain it in cell form, as opposed to a 4x3 matrix for example.
采纳的回答
更多回答(1 个)
per isakson
2012-11-17
Not with plain indexing. This one-liner does it
r = cellfun( @(v) v(1), A )
However, ...
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!