MATLAB: How to divide and times in matlab

divide times

Hey everyone!
Basically im trying to write my fist line of code, in matlab, to the given formula: |G(jw) |= 1/√(R^2+(wL- 1/wC)^2 ) Now, im not sure how to get the 1/wC term as I do not know how to divide in matlab. also, how do I get the ^2? All I want is the general form as an answer. I should be able to get it from there! Thanks!

Best Answer

* % matrix multiply
.* %scalar multiply
/ % matrix divide
./ % scalar divide
^ % exponentiation
.^ % element-by-element exponentiation
so for your equation:
1./sqrt((R.^2+(w.*L-1/(w.*c)).^2));