How to do this programming
Show older comments
Hello,
I have X=[1,2,3,4,5,..........,20]
Now I want to divide X into 5 blocks where each block should contain 4 elements..
I need B1=[1,2,3,4]
then B2=[5,6,7,8]and so on
Accepted Answer
More Answers (1)
Image Analyst
on 28 May 2013
I know it seems really obvious, but have you tried:
B1 = X(1:4);
B2 = X(5:8);
B3 = X(9:12);
B4 = X(13:16);
B5 = X(17:20);
Categories
Find more on Loops and Conditional Statements 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!