Effacer les filtres
Effacer les filtres

Splitting a matrix into 2 sub matrices based on row number

1 vue (au cours des 30 derniers jours)
Danning Zhang
Danning Zhang le 26 Fév 2020
Commenté : Danning Zhang le 26 Fév 2020
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!

Réponse acceptée

David Hill
David Hill le 26 Fév 2020
y=M([1 4 7 8 9 10],:);
z=M([2 3 5 6],:);

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by