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?

 Respuesta aceptada

the cyclist
the cyclist el 14 de Dic. de 2011

16 votos

[m,n] = size(A)

4 comentarios

eri
eri el 14 de Dic. de 2011
thank you
Muhammad nasiri
Muhammad nasiri el 14 de Nov. de 2017
thanks
Ali Faragallah
Ali Faragallah el 14 de Mzo. de 2021
thank you
Alexander
Alexander el 20 de En. de 2025
thanks

Iniciar sesión para comentar.

Más respuestas (2)

Md. Kawsar Ahmed Asif
Md. Kawsar Ahmed Asif el 13 de Dic. de 2017
Editada: Md. Kawsar Ahmed Asif el 13 de Dic. de 2017

0 votos

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

0 votos

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

Categorías

Etiquetas

Preguntada:

eri
el 14 de Dic. de 2011

Comentada:

el 20 de En. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by