title: How should I autofit this Matlab plot?
body: <pre><code>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
  </code></pre>
  
  <p>From the code you can tell that I am trying to get the graph result from graph....but when it outputs, I get the values on the command window, but the figure shows a straight line @ zero...how do I auto scale the y-axis here??</p>