summaryrefslogtreecommitdiff
path: root/macros/rectwin.sci
blob: 1be0c0f3f31160486a72ee97d556e5c2d6f13bcd (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
33
34

function w = rectwin (m)
//function [y] = rectwin (m)
//This function returns the filter coefficients of a rectangular window.
//Calling Sequence
//y = rectwin (m)
//Parameters
//m: positive integer value
//y: output variable, vector of real numbers
//Description
//This is an Octave function.
//This function returns the filter coefficients of a rectangular window of length m supplied as input, to the output vector y.
//Examples
//rectwin(3)
//ans  =
//    1.
//    1.
//    1.


 funcprot(0);
    rhs= argn(2);

  if (rhs ~= 1)
     error("Wrong Number of input arguments");
  end

  if (~ (isscalar (m) & (m == fix (m)) & (m > 0)))
    error ("rectwin: M must be a positive integer");
  end

  w=ones(m,1);

endfunction