how can I divide the vector into parts
24 views (last 30 days)
Show older comments
Cem Özdemir
on 19 Jan 2021
Commented: Cem Özdemir
on 20 Jan 2021
I have a vector (1x65536). I want to divide this vector at regular intervals. but I failed. Can you help me?
for example
i = [153,142,44,22,55, ... ,52] (1x65536)
i1 = [153,142,44,55, ... , 40] (1x20)
i2 = [144,122,144,655, ... , 40] (1x20)
.
.
.
ixx = [44,55,77,22, ... , 52] (1x16)
0 Comments
Accepted Answer
KALYAN ACHARJYA
on 19 Jan 2021
Edited: KALYAN ACHARJYA
on 19 Jan 2021
data_cell=mat2cell(data,1,[20*ones(1,3276),16])
Result, save the all sub array data in cell array having cell elements 3227, where all cell element size is 1x20, except last one, which is 1x16
>> whos data_cell
Name Size Bytes Class Attributes
data_cell 1x3277 ?? cell
Or you may check here
Convert array to cell array with consistently sized cells
More Answers (0)
See Also
Categories
Find more on Cell Arrays 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!