Matrix (Resultant from an Expression) Indexing
2 次查看(过去 30 天)
显示 更早的评论
Say I want to get the length of an array A . Normally I would do:
[m,n]=size(A)
And then use the n in other expressions.
But what if I want to get my n immediately; is there anything of the form
n=size(A)(2)
analogous to how I would pull the second element n from an array N using
n=N(2)
?
0 个评论
采纳的回答
Wayne King
2013-12-26
编辑:Wayne King
2013-12-26
Yes
A = randn(20,10);
size(A,2)
size(A,1)
So
N = size(A,2);
Did you read the help?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!