How to take each 10 rows and put it in different group
1 view (last 30 days)
Show older comments
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 Comment
Jan
on 4 Mar 2021
Edited: Jan
on 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.
Answers (1)
Jan
on 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 Comments
Jan
on 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.
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!