summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authormatt2007-06-02 16:13:08 +0000
committermatt2007-06-02 16:13:08 +0000
commitd476abb6debdf8ef5c0adf97af50a9b704605e2a (patch)
treefc1eee4921d8406e17c8dfadd74cceda2db33362 /gnuradio-core/src
parent308f6e2ce98175aa50118f679c4b2361e3087dcd (diff)
downloadgnuradio-d476abb6debdf8ef5c0adf97af50a9b704605e2a.tar.gz
gnuradio-d476abb6debdf8ef5c0adf97af50a9b704605e2a.tar.bz2
gnuradio-d476abb6debdf8ef5c0adf97af50a9b704605e2a.zip
useful for splitting up packets
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5605 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/utils/split_vect.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/gnuradio-core/src/utils/split_vect.m b/gnuradio-core/src/utils/split_vect.m
new file mode 100644
index 000000000..c492581e4
--- /dev/null
+++ b/gnuradio-core/src/utils/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
+