How to take each 10 rows and put it in different group
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a matrix with 2000*512 and I want to take each 10 othe rows and put it in a group. so total of 200 gorups each has 10 of my matrix
please I need a solution as soon as possible
1 commentaire
Jan
le 4 Mar 2021
Modifié(e) : Jan
le 4 Mar 2021
Remember that the answers are given by voluntary users in their sparetime. Then the term "as soon as possible" is not appropriate. Your question is not more urgent than the others.
You did not explain, what you call a "group". It would help to solve your problem, if you mention, what your goal is. A small example with a [6 x 3] matrix and 2 "groups" might be useful.
Réponses (1)
Jan
le 4 Mar 2021
X = rand(2000, 512);
Y = reshape(X, 10, 200, 512);
% perhaps: Y = reshape(X, 200, 10, 512)?
% perhaps PERMUTE() such that the group index is the 3rd one?
Now you have an additional index for the group.
3 commentaires
Jan
le 4 Mar 2021
You did not mention yet, what a "group" is.
A [200 x 10 x 512] array can be used as "group" using the first index as "group counter".
"in this way for example y(1,:) is a one row with 5120 value which is not like what i want"
y(1,:, :) is a [10 x 512] matrix.
Please do not explain, what you do not want, but define clearly, what you do want. The readers cannot guess this detail.
Voir également
Catégories
En savoir plus sur Matrix Indexing 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!