A is an MxN matrix. To get the number of columns of A I can do the following:
s = size(A);
ncol = s(2);
How can I construct a direct expression avoiding the intermediary variable s?

 Respuesta aceptada

Cedric
Cedric el 16 de Oct. de 2017
[nRows, nCols] = size( A ) ;
if you don't need nRows:
[~, nCols] = size( A ) ;

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 16 de Oct. de 2017

Editada:

el 16 de Oct. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by