how to plot the 3d graph

2 visualizzazioni (ultimi 30 giorni)
AKSHAYA RAUTA
AKSHAYA RAUTA il 9 Feb 2016
Risposto: John BG il 7 Mar 2016
dgh:= 0.09954;
Delta:=-0.68429;
sx:=-0.01098;
sy:= 0.05126;
Esup:=sx*x+sy*y+dgh*((x^2+y^2)/2+Delta*(x^2-y^2)/2)^(1/2);
Einf:=sx*x+sy*y-dgh*((x^2+y^2)/2+Delta*(x^2-y^2)/2)^(1/2);
how to plot the graphs of the two functions in the same plot.
  2 Commenti
Walter Roberson
Walter Roberson il 9 Feb 2016
Please confirm that you want to plot within a MuPad notebook and not within MATLAB.
Sarah Palfreyman
Sarah Palfreyman il 7 Mar 2016
Have you seen the fplot family of functions in R2016a?

Accedi per commentare.

Risposte (1)

John BG
John BG il 7 Mar 2016
Hi Akshaya
the straight way to visualize the function boundaries is, for Esup
dgh= 0.09954;
Delta=-0.68429;
sx=-0.01098;
sy= 0.05126;
x=[-20:1:20];y=[-20:1:20]
[X,Y]=meshgrid(x,y)
Esup=sx*X+sy*Y+dgh*(abs((X.^2+Y.^2)/2+Delta*(X.^2-Y.^2)/2)).^.5
figure(1);surf(X,Y,Esup)
and Einf:
figure(2);surf(X,Y,Einf)
I had to add the abs() otherwise the boundaries showed complex values when attempting to solve sqrt of negative values.
To plot both boundaries in same graph use command hold:
figure(1);hold all;surf(X,Y,Einf)
If you find this answer of any help solving your question, please click on the thumbs-up vote link,
thanks in advance
John

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by