summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/utils/split_vect.m
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core/src/utils/split_vect.m')
-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
+