# drawing complex equation in 2D

1 view (last 30 days)
Firas Kareem on 25 Oct 2020
Answered: Cris LaPierre on 26 Oct 2020
Dear Folks ,
kindly I need your help to plot the following equation :
P=151920000/w -(2673792000*w^2*cos(w) + w*sin(w)*44299872000i - 80736516720000*cos(w))/(w*(4*w - 729)*(4*w + 729)) + (243072000*w*exp((729i)/4))/((4*w - 729)*(4*w + 729))
w=1e06:100e06:1e09

Cris LaPierre on 26 Oct 2020
You've already done all the hard work. Just define w first, and then use elementwise multiplication and division. You can use abs to plot the magnitude of P since it contains imaginary numbers. You could also use real() or imag() to plot the real or imaginary part, respectively.
If you are just getting started with MATLAB, I suggest going through MATLAB Onramp. It will introduce you to the MATLAB environment as well as the fundamentals of programming in MATLAB. Once you complete it, you'll be able to do this an much more on your own.
w=1e06:100e06:1e09;
P=151920000./w -(2673792000*w.^2.*cos(w) + w.*sin(w)*44299872000i - 80736516720000*cos(w))./(w.*(4*w - 729).*(4*w + 729)) + (243072000*w*exp((729i)/4))./((4*w - 729).*(4*w + 729));
plot(w,abs(P)) 