Rearranging array based on number of steps.
3 次查看(过去 30 天)
显示 更早的评论
Hi everybody,
Let's say I have a vector such as:
A = (1:24)
And I'd like to separate this array into a 2x12 matrix where the first row will show the first 3 positions skipping the next three and so on... The second row will do the same thing but starting from the fourth position. This is the expexted output:
Output = [1 2 3 7 8 9 13 14 15 19 20 21; 4 5 6 10 11 12 16 17 18 22 23 24]
I could do this manually, but some times I'd like it to take 2 or 4 steps instead of 3, as it is in the example above.
Any ideas of how to to achieve this?
Thank you in advanced,
Santos
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!