indexing entry of a matrix result

1 次查看(过去 30 天)
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?

采纳的回答

Cedric
Cedric 2017-10-16
[nRows, nCols] = size( A ) ;
if you don't need nRows:
[~, nCols] = size( A ) ;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by