how to count row and column of a matrix

조회 수: 863 (최근 30일)
eri
eri 2011년 12월 14일
댓글: Alexander 2025년 1월 20일 21:48
if i have a big matrix and i don't know its size, how to find out its size? and how to save it as variable?

채택된 답변

the cyclist
the cyclist 2011년 12월 14일
[m,n] = size(A)
  댓글 수: 4
Ali Faragallah
Ali Faragallah 2021년 3월 14일
thank you
Alexander
Alexander 2025년 1월 20일 21:48
thanks

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

추가 답변 (2개)

Md. Kawsar Ahmed Asif
Md. Kawsar Ahmed Asif 2017년 12월 13일
편집: Md. Kawsar Ahmed Asif 2017년 12월 13일
[rownum,colnum]=size(A)
Where 'A' is a mxn matrix.

Anurag Pratap Singh
Anurag Pratap Singh 2020년 6월 25일
Hii Eri
To know the size of a matrix you can use the size function and pass your matrix in it
[NumRows NumCols]=size(your_matrix);
The first output is the Number of rows and second the number of columns
Thank you

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by