how to count row and column of a matrix

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?

 Réponse acceptée

the cyclist
the cyclist le 14 Déc 2011

16 votes

[m,n] = size(A)

4 commentaires

eri
eri le 14 Déc 2011
thank you
Muhammad nasiri
Muhammad nasiri le 14 Nov 2017
thanks
Ali Faragallah
Ali Faragallah le 14 Mar 2021
thank you
Alexander
Alexander le 20 Jan 2025
thanks

Connectez-vous pour commenter.

Plus de réponses (2)

Md. Kawsar Ahmed Asif
Md. Kawsar Ahmed Asif le 13 Déc 2017
Modifié(e) : Md. Kawsar Ahmed Asif le 13 Déc 2017

0 votes

[rownum,colnum]=size(A)
Where 'A' is a mxn matrix.
Anurag Pratap Singh
Anurag Pratap Singh le 25 Juin 2020

0 votes

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

Catégories

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by