function [h,w,y,graph] = lowpassFIR(sample)
%Calculates Finite Impulse Response low pass filter coefficient
%using the windowing methods as well
passEdge = 100;
StopbandAtt = 20;
passbandRip =.05;
transWidth = 10;
Fs = sample;
%Step One: select number of coefficients%
deltaF = transWidth/Fs;
%Normalize for each window
rectN = round(0.9/deltaF);
hannN = round(3.1/deltaF);
hammN = round(3.3/deltaF);
blackN = round(5.5/deltaF);
rectN = 1:rectN
%rectPos = round(rectN/2);
%rectNeg = round((rectPos*-1));
%For the Vector Array
%rect = rectNeg:rectPos;
deltaSum= passEdge + (transWidth/2);
deltaF2= deltaSum/Fs;
h=zeros(size(1:rectN(end)));
w=zeros(size(1:rectN(end)));
y=zeros(size(1:rectN(end)));
graph = plot(y)
for i = 1:rectN(end)
%iterate through each value and plug into function in for loop
%each output of the function will be stored into another array
h(i) = 2*deltaF2*(sin(i*2*pi*deltaF2))/(2*i*pi*deltaF2);
w(i) = 0.5 + 0.5*cos(2*pi*i/rectN(end));
y(i) = h(i)*w(i);
graph(i) = y(i);
end
コードから、グラフからグラフの結果を取得しようとしていることがわかります....しかし、出力すると、コマンドウィンドウで値を取得しますが、図には直線@ゼロが表示されます...どうすればよいですかここでy軸を自動スケーリングしますか??