Splitting a matrix into 2 sub matrices based on row number

3 ビュー (過去 30 日間)
Danning Zhang
Danning Zhang 2020 年 2 月 26 日
コメント済み: Danning Zhang 2020 年 2 月 26 日
I have a 10x22 matrix, which I need to split into one 6x22 and one 4x22.
I want rows 1, 4, 7, 8, 9, 10 from the 10x22 matrix to become the 6x22 matrix, and the remaining rows to become the 4x22 matrix.
How can I do that?
Thanks!

採用された回答

David Hill
David Hill 2020 年 2 月 26 日
y=M([1 4 7 8 9 10],:);
z=M([2 3 5 6],:);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by