MATLAB: I could use some help entering this formula into matlab.

formulafrequencyplotplotting

f is logspace(a,b)… while r l and c are user input constants. I need to plot it using loglog, but I can't find an explanation on how to correctly enter the syntax of the formula, could someone please point me in the right direction? It would be greatly appreciated! Can it be done with one line as magnitude = sqrt( )?

Best Answer

magnitude = sqrt(R.^2 + (2*pi*f*L - 1./(2*pi*f*C)).^2);