takespecific elements from matrix to build new one

hey everybody i have 40*10 matrix i want to build new one that contain the first 10 rows (1:10,:) and the third 10 rows (31:40,:) so the new matrix will contain 20*10 . thanks in advance.

 Akzeptierte Antwort

Chris C
Chris C am 12 Mär. 2014
Bearbeitet: Chris C am 12 Mär. 2014

1 Stimme

If your original matrix is called A, then
B = [A(1:10,:); A(31:end,:)];

Weitere Antworten (0)

Kategorien

Gefragt:

am 12 Mär. 2014

Bearbeitet:

am 12 Mär. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by