#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# help with plotting an equation

Posts: 2Member
Hello!

I need help with plotting equation in matlab. I need to plot curve using an equation. The curve should look like that one in attached picture (please do not mind description)

so far ive tried this, but it plots only one point. i dont know how to correctly use for cycles. This is my m-file:

[code]

Q=0.49;

Rac=0.0015;

freq=20000;

Cr=1/(2*pi*Q*freq*Rac);

Lr=1/(((2*pi*freq)^2)*Cr);

Lp=m*Lr;

w=2*pi*freq;

w0=1/(sqrt(Lr*Cr));

wp=1/(sqrt(Lp*Cr));

Race=14685.973;

Qe=(sqrt(Lr/Cr))*(1/Race);

%///////////////////////////////////////

for m=1:0.1:5;

for freq=20000:10:30000;

((w^2)/(w0^2)*(sqrt(m*(m-1))))/(((w^2)/((wp^2))-1)+1i*(w/w0)* (((w^2)/(w0^2))-1)*(m-1)*Qe);

end

end

[/code]

i was trying to plot the curve using command[code] plot(freq,m)[/code]in command window

Any help would be much appreciated.
· ·