how to count row and column of a matrix

1.008 visualizzazioni (ultimi 30 giorni)
eri
eri il 14 Dic 2011
Commentato: Ali Faragallah il 14 Mar 2021
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?

Risposta accettata

the cyclist
the cyclist il 14 Dic 2011
[m,n] = size(A)

Più risposte (2)

Md. Kawsar Ahmed Asif
Md. Kawsar Ahmed Asif il 13 Dic 2017
Modificato: Md. Kawsar Ahmed Asif il 13 Dic 2017
[rownum,colnum]=size(A)
Where 'A' is a mxn matrix.

Anurag Pratap Singh
Anurag Pratap Singh il 25 Giu 2020
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

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by