Grouping rows into different matrices

2 Ansichten (letzte 30 Tage)
omar najjar
omar najjar am 4 Mär. 2021
Bearbeitet: Stephen23 am 4 Mär. 2021
I have a matrix of 2000*512 and I want to assign each 10 to a matric so with total of 200 matrices
G1 = M(1:10 , :)
G2 = M(11:20, :) and so on
How can I do it in more professional way since I need to reach to G200
Please Help
  1 Kommentar
Stephen23
Stephen23 am 4 Mär. 2021
Bearbeitet: Stephen23 am 4 Mär. 2021
"How can I do it in more professional way since I need to reach to G200 "
The "more professional way" would be to avoid numbered variables entirely and use a simple cell array.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 4 Mär. 2021
Bearbeitet: KALYAN ACHARJYA am 4 Mär. 2021
G=mat2cell(M,10*ones(1,2000/10))
All are individual matrices, you have to save matrices in the cell array (easiest way)

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by