how to count row and column of a matrix

977 次查看(过去 30 天)
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)

更多回答(2 个)

Md. Kawsar Ahmed Asif
编辑:Md. Kawsar Ahmed Asif 2017-12-13
[rownum,colnum]=size(A)
Where 'A' is a mxn matrix.

Anurag Pratap Singh
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 中查找有关 Resizing and Reshaping Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by