if i have matrix x is 4 by 5, how can I retrieve the the row number and save it into y

 採用された回答

Matt Tearle
Matt Tearle 2011 年 2 月 18 日
y = size(x,1)

2 件のコメント

Matt Tearle
Matt Tearle 2011 年 2 月 18 日
FYI, z = size(x,2) gives you the number of columns
Hello Blower
Hello Blower 2011 年 2 月 18 日
thanks a lot

サインインしてコメントする。

その他の回答 (1 件)

Matt Fig
Matt Fig 2011 年 2 月 18 日
x = ceil(rand(4,5)*20); % An example matrix.
y = size(x,1); % Is this what you mean?
y2 = x(4,:); % Or did you mean this?

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by