title: How to plot frequency response for a transfer function of a band-pass filter in Matlab?
body: <p>i want write a script to plot a graph for the transfer function [H(f)] for a band pass filter, |H(f)| against frequency and the phase of H(f) (degrees) against frequency, im very new to matlab so the syntax is not 100%, im getting confused because everything is auto formatted in matrix form.
  below is my script:</p>
  
  <pre><code>% RCL circuit: band-pass filter
  R=55590; L=0.9571; C=48.811*10.^(-9);      % values of the Resistor and Capacitor
  f=(0:60e3); w=2*pi*f;                      % frequency (f) range of measurements
  H=(R./(sqrt(R^2+(w*L-(1./(w*C))).^2)));    % Transfer Function
  
  % Magnitude (absolute value) of the transfer function
  plot(f,abs(H),'LineWidth',2); grid on; hold on
  xlabel('Frequency [Hz]','FontSize',20); ylabel('|H(f)|','FontSize',20)
  </code></pre>
  
  <p>figure </p>
  
  <pre><code>plot(f,angle(H)*180/pi,'LineWidth',2); grid on; hold on
  xlabel('Frequency [Hz]','FontSize',18); 
  ylabel('phase of H(f) [degrees]','FontSize',20)
  </code></pre>
  
  <p>this is the transfer function formula im using
  <img src="https://i.stack.imgur.com/oFu7Q.png" alt="enter image description here"> </p>
  
  <p>below is another pic of what my experimental results were and an expected graph, i just dont understand why MATLAB isnt ploting what i want?
  <img src="https://i.stack.imgur.com/1Oe7D.png" alt="enter image description here"></p>