title: How to plot the frequency response of butterworth filters using MATLAB
body: <p>I constructed a code to design 4 filters using butterworth IIR. Low,high,bandpass and bandstop.
  Input Diolog window opens up to take in user inputs, I set the default values to :</p>
  
  <pre><code>def = {'5','200','40','50','3','30'}; for Low and High pass
  AND
  def = {'5','500','60', '200','50','250','3','30'}; for bandpass and bandstop
  Order of Filter
  Fsampling (Hz)
  Fpass (Fpass 1 and 2) (Hz)
  Fstop (Fstop 1 and 2) (Hz)
  Ripple factors (dB)
  Stop attenuation (dB)
  </code></pre>
  
  <p>for the time being.and using a for loop (1-->4) to calculate B and A components</p>
  
  <pre><code>   [n Fn] = buttord(Fpass,Fstop,Rp,Rs);
     [B,A] = butter(N,Fn,str);
     B_Comp{i} = B;
     A_Comp{i} = A;
  </code></pre>
  
  <p>Now..I need to plot their frequency responses for each filter, so  using </p>
  
  <pre><code>for i=1:4
     freqz(B_Comp(i),A_Comp(i));
     figure;
  end
  </code></pre>
  
  <p>But this error comes up :</p>
  
  <pre><code> ??? Function 'fft' is not defined for values of class 'cell'.
  Error in ==&gt; fft at 36
     [varargout{1:nargout}] = builtin('fft', varargin{:});
  
  Error in ==&gt; freqz at 94
      h = dividenowarn(fft(b,s.*nfft),fft(a,s.*nfft)).';
  
  Error in ==&gt; dsp1 at 62
      freqz(B_Comp(i),A_Comp(i));
  </code></pre>
  
  <p>How do i solve this problem.. any help is appreciated</p>