diff options
Diffstat (limited to 'gr-utils/octave/split_vect.m')
-rw-r--r-- | gr-utils/octave/split_vect.m | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gr-utils/octave/split_vect.m b/gr-utils/octave/split_vect.m new file mode 100644 index 0000000000..aef5c5c383 --- /dev/null +++ b/gr-utils/octave/split_vect.m @@ -0,0 +1,15 @@ +% split vector into packets + +function y = split_vect(vect,N) + Z = floor(max(size(vect))/N); + y = []; + if(size(vect)(1)>size(vect)(2)) + v = vect'; + else + v = vect; + end + for i=1:Z + y(i,1:N) = v((i-1)*N+1:i*N); + end +end + |