how to count row and column of a matrix

979 visualizaciones (últimos 30 días)
eri
eri el 14 de Dic. de 2011
Comentada: Ali Faragallah el 14 de Mzo. de 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?

Respuesta aceptada

the cyclist
the cyclist el 14 de Dic. de 2011
[m,n] = size(A)
  3 comentarios
Muhammad nasiri
Muhammad nasiri el 14 de Nov. de 2017
thanks
Ali Faragallah
Ali Faragallah el 14 de Mzo. de 2021
thank you

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
[rownum,colnum]=size(A)
Where 'A' is a mxn matrix.

Anurag Pratap Singh
Anurag Pratap Singh el 25 de Jun. de 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

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by