diff options
author | shamikam | 2017-11-07 15:59:48 +0530 |
---|---|---|
committer | shamikam | 2017-11-07 15:59:48 +0530 |
commit | c0c0582462720ed597b00e116506570577614e89 (patch) | |
tree | 31dedd23698e5357b19c810b7d7a8464100ef44a /macros/rectpuls.sci | |
download | FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.gz FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.bz2 FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.zip |
initial commit
Diffstat (limited to 'macros/rectpuls.sci')
-rw-r--r-- | macros/rectpuls.sci | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/macros/rectpuls.sci b/macros/rectpuls.sci new file mode 100644 index 0000000..2796ef0 --- /dev/null +++ b/macros/rectpuls.sci @@ -0,0 +1,28 @@ +function [y]=rectpuls(t,w) + +// Generates a Rectangular pulse based on the width and sampling times. +// Calling Sequence +// [y]=rectpuls(t) +// [y]=rectpuls(t,w) +// Parameters +// t: Real or complex valued vector or matrix +// w: Real or complex valued vector or matrix +// Description +// This is an Octave function +// y = rectpuls(t) returns a continuous, aperiodic, unity-height rectangular pulse depending upon input t, centered about t=0 and having default width of 1. +// y = rectpuls(t,w) generates a rectangle of width w. +// Examples +// 1. rectpuls([10 100 1000 13 839],27) +// ans = 1 0 0 1 0 +// 2. rectpuls([1000 1000 100 100]) +// ans = 0 0 0 0 + +funcprot(0); +rhs=argn(2); +if (rhs<1) then + error ("Wrong number of input arguments.") +elseif (rhs==1) + y=callOctave("rectpuls",t) +else y=callOctave("rectpuls",t,w) +end +endfunction |