summaryrefslogtreecommitdiff
path: root/macros/upsamplefill.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/upsamplefill.sci')
-rw-r--r--macros/upsamplefill.sci32
1 files changed, 32 insertions, 0 deletions
diff --git a/macros/upsamplefill.sci b/macros/upsamplefill.sci
new file mode 100644
index 0000000..60ca1da
--- /dev/null
+++ b/macros/upsamplefill.sci
@@ -0,0 +1,32 @@
+function y = upsamplefill (x, w, cpy)
+//This function upsamples a vector interleaving given values or copies of the vector elements.
+//Calling Sequence
+//y = upsamplefill (x, w)
+//y = upsamplefill (x, w, cpy)
+//Parameters
+//x: scalar, vector or matrix of real or complex numbers
+//w: scalar or vector of real or complex values
+//cpy: can take in "true" or "false", default is false
+//Description
+//This is an Octave function.
+//This function upsamples a vector interleaving given values or copies of the vector elements.
+//The second argument has the values in the vector w that are placed in between the elements of x.
+//The third argument, if true, means that w should be scalar and that each value in x repeated w times.
+//Examples
+//upsamplefill([0.4,0.5],7)
+//ans =
+// 0.4 7. 0.5 7.
+funcprot(0);
+rhs = argn(2)
+
+if(rhs<2 | rhs>3)
+error("Wrong number of input arguments.")
+end
+
+ select(rhs)
+ case 2 then
+ y = callOctave("upsamplefill", x, w)
+ case 3 then
+ y = callOctave("upsamplefill", x, w, cpy)
+ end
+endfunction