I have equations for S11 and S21 parameters for a bandpass filter which are obviously frequency dependent. I know there are commands like sparameters() and rfplot() used specifically for plotting S parameter in Matlab. But I can't find the equations these commands use. Also I can't get the right plot from my code no matter what I try. The S parameter I get from equation are complex doubles. Using abs() command or magnitude formula sqrt(a^2+b^2) yeilds 1 for all frequency values so I assumed I should just ignore the imaginary part and plot the real part of S11. Am I correct? Should I convert just the real part of S11 to dB using 10log(S11)? I would appreciate any help you can give especially if you have made s parameter plots on Matlab using your own equation.