how to change the value of a group of number

2 views (last 30 days)
Dear All,
I am trying to do the following things but get stuck.
I have one matrice containing:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Every five group, I would like to change with the first five values, so it becomes:
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
Any tips for that?
Thanks Sypou

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 13 Apr 2012
a = 1:15
out = rem(a-1,5)+1

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!