shah
shah

Reputation: 311

Group elements in a cell in matlab

I have a cell size of 1x142884 (I have 142884 elements in a single cell) and I am interested to group these elements in a cell of 36 each. So I must have 142884 / 36 = 3969 cells. Can someone help me to group those cells where each cell consist of 36 cells.
EDIT
Here is my code

yaml_file = 'Feature000000';
YamlStruct = ReadYaml(yaml_file);
feature0 =  YamlStruct.features1;
blocks_per_img = YamlStruct.blockperimg;

You can download Feature000000 file from here

Upvotes: 0

Views: 81

Answers (1)

Erik
Erik

Reputation: 4563

Use reshape as follows:

B = reshape(C,36,3969)

You'll end up with a cell B of size 36×3969, so every row is one of the 36 items with length 3969.

Upvotes: 1

Related Questions