summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/utils/runsum.m
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core/src/utils/runsum.m')
-rw-r--r--gnuradio-core/src/utils/runsum.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/gnuradio-core/src/utils/runsum.m b/gnuradio-core/src/utils/runsum.m
new file mode 100644
index 000000000..0f530b015
--- /dev/null
+++ b/gnuradio-core/src/utils/runsum.m
@@ -0,0 +1,9 @@
+function r = runsum(x)
+ len = length(x);
+ r = zeros (1, len);
+ r(1) = x(1);
+ for i = 2:len;
+ r(i) = r(i-1) + x(i);
+ endfor;
+endfunction;
+