plot curves in matlab

Hi. How can i plot below equation(qa vs w)?
thank you
(9*w^4*cos(qa))/28000000 - (33*w^2*cos(qa))/32000 - (105*cos(qa))/64 + (603*w^2)/2560000 - (4891*w^4)/4480000000 + (93*w^6)/560000000000 + 105/64=0

Risposte (2)

John D'Errico
John D'Errico il 15 Ago 2020
Modificato: John D'Errico il 15 Ago 2020
fun = @(w,qa) (9*w.^4.*cos(qa))/28000000 - (33*w.^2.*cos(qa))/32000 - (105*cos(qa))/64 + (603*w.^2)/2560000 - (4891*w.^4)/4480000000 + (93*w.^6)/560000000000 + 105/64;
fimplicit(fun)
You can tell fimplicit how far out to go of course.
fimplicit(fun,[-100 100 -100 100])
It does appear as if much is happening when you broaden the view.

2 Commenti

saman ahmadi
saman ahmadi il 15 Ago 2020
thanks. from plotting sended equation must plot a curve like image attachmented.
John D'Errico
John D'Errico il 15 Ago 2020
Modificato: John D'Errico il 15 Ago 2020
Sigh. It would have helped if you asked that question in the first place, instead of just asking how to plot qa as a function of w.
fun = @(qa,w) (9*w.^4.*cos(qa))/28000000 - (33*w.^2.*cos(qa))/32000 - (105*cos(qa))/64 + (603*w.^2)/2560000 - (4891*w.^4)/4480000000 + (93*w.^6)/560000000000 + 105/64;
fimplicit(fun,[-pi pi 0 100])
If you are looking for a specific result, then you need to tell people. That seems to come pretty close, though the scaling of the variables seems to be different from the plot you show. That is more a question of the specific function you gave us, which is surely different from that which generated your plot.

Accedi per commentare.

Alan Stevens
Alan Stevens il 15 Ago 2020
Somethig like this:
qafn = @(w) acos(( 4891*w.^4/4480000000 -93*w.^6/560000000000 -603*w.^2/2560000 -105/64 )...
./(9*w.^4/28000000 - 33*w.^2/32000 - 105/64 ));
w = -50:50;
qa = qafn(w);
plot(w,qa)

6 Commenti

saman ahmadi
saman ahmadi il 15 Ago 2020
thanks. from plotting sended equation must plot a curve like image attachmented.
Alan Stevens
Alan Stevens il 15 Ago 2020
Modificato: Alan Stevens il 15 Ago 2020
So change the plotting range from -pi to pi in steps of pi/100, say, i.e. replace
w = -50:50;
with
w = -pi:pi/100:pi;
saman ahmadi
saman ahmadi il 15 Ago 2020
tihs code plot(w,qa) but, i want to plot (qa,w), how can i do it?
Alan Stevens
Alan Stevens il 15 Ago 2020
Oops! I've inverted everything!
Alan Stevens
Alan Stevens il 15 Ago 2020
Modificato: Alan Stevens il 15 Ago 2020
Looks like the implicit function is the way to go, though the w axis is scaled differently.
qawfn = @(qa,w) (9*w.^4.*cos(qa))/28000000 - (33*w.^2.*cos(qa))/32000 - (105*cos(qa))/64 ...
+ (603*w.^2)/2560000 - (4891*w.^4)/4480000000 + (93*w.^6)/560000000000 + 105/64;
fimplicit(qawfn,[-pi pi 0 90])
saman ahmadi
saman ahmadi il 15 Ago 2020
thank you very much
dear Alan Stevens

Accedi per commentare.

Categorie

Richiesto:

il 15 Ago 2020

Modificato:

il 15 Ago 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by