How to create a smaller matrix from a larger one?

2 ビュー (過去 30 日間)
Rand Renwar
Rand Renwar 2016 年 9 月 30 日
編集済み: KSSV 2016 年 9 月 30 日
So if I were to have a matrix M
M = [ 0 4 5 6
3 9 1 4];
And I wanted to create a smaller Matrix Z from M
Z = [ 5
1]
What would be the easiest/fastest way to do this?

採用された回答

KSSV
KSSV 2016 年 9 月 30 日
編集済み: KSSV 2016 年 9 月 30 日
Z = M(:,3) ; % Z happens to be a third column in M
Read about matrix indexing.
https://in.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by