Split a vector
Show older comments
Hi,
I have a question regarding vectors: I have a vector of size n and I want to split the vector by a matlab function so that I get elements 1-10, 2-11, 3-12....
Is there any built-in-function?
Thanks!
Accepted Answer
More Answers (1)
fcarl
on 21 Sep 2011
1 Comment
Grzegorz Knor
on 21 Sep 2011
In my opinion I've given the solutions in the post above :)
x=10;
vec=1:1000;
[i1 i2] = meshgrid(0:x-1,1:length(vec)-x+1);
result = vec(i1+i2)
Categories
Find more on Get Started with MATLAB 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!