summaryrefslogtreecommitdiff
path: root/macros/upsamplefill.sci
blob: 60ca1da76209bd623fdc898db5da1c0e54ae57bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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