Matrix (Resultant from an Expression) Indexing

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)
?

 채택된 답변

Wayne King
Wayne King 2013년 12월 26일
편집: Wayne King 2013년 12월 26일

0 개 추천

Yes
A = randn(20,10);
size(A,2)
size(A,1)
So
N = size(A,2);
Did you read the help?

댓글 수: 2

A.
A. 2013년 12월 29일
Thank you. I did read the help, but it seems not attentively enough.
Am I assuming similar functions will follow the same pattern f(A,n) , where n is [1 to max size of the output array].
Wayne King
Wayne King 2013년 12월 29일
yes

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

A.
2013년 12월 26일

댓글:

2013년 12월 29일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by