Implicit function 2D plot

I am trying to plot a function of the form
y=f(x,y)
That is y as a function of x. Any help?
Thanks

Réponses (1)

madhan ravi
madhan ravi le 9 Nov 2018
Modifié(e) : madhan ravi le 9 Nov 2018

0 votes

fimplicit(@(x,y) x.^2 - y.^2 - 1)
fplot(@(x) sin(x))
syms x y
f(x, y) = sin(x + y)*sin(x*y);
ezplot(f)

8 commentaires

T S Singh
T S Singh le 9 Nov 2018
@madhan I am using 2015 version so 'fimplicit' is not available. Can you please suggest me any other way.
madhan ravi
madhan ravi le 9 Nov 2018
Modifié(e) : madhan ravi le 9 Nov 2018
Use ezplot , if it doesn’t work either upload your function here
om = 4.0264e+05;
sd=.3*om;
k3=0.01;
ld=0.085;
c0=@(a)-(om^2+(3/4)*k3*a^2)*sd^2+(om^2+(3/4)*k3*a^2)*(om^2+(3/4)*k3*a^2+ld^2+2*y*ld+(3/2)*k3*a^2);
c1=@(a)2*(om^2+(3/4)*k3*a^2)*(2*y+ld)+2*y*(ld^2+2*y*ld+(3/2)*k3*a^2);
c2=@(a)2*(om^2+(3/4)*k3*a^2)+(3/2)*k3*a^2+ld^2+4*y^2+6*y*ld;
c3=2*(2*y+ld);
b1=@(dm)-2*dm*om*(y+ld);
b2=@(a,dm)(om^2+(3/4)*k3*a^2)+(3/2)*k3*a^2+ld^2+2*y*ld-(dm*om)^2;
eq=@(a,dm)sqrt((b1(dm)^2+b2(a,dm)^2)/(((dm*om)^4-c2(a)*(dm*om)^2+c0(a))^2+(c3*(dm*om)^3-c1(a)*dm*om)^2))-a;
I want to plot 'a vs dm' for dm=[0,3]
Thanks
madhan ravi
madhan ravi le 9 Nov 2018
a and dm are arguments not equations be specific with clear explanation
eq=@(a,dm)sqrt((b1(dm)^2+b2(a,dm)^2)/(((dm*om)^4-c2(a)*(dm*om)^2+c0(a))^2+(c3*(dm*om)^3-c1(a)*dm*om)^2));
a=eq(a,dm);
I suppose the last expression is of the form
y=f(x,y)
Thanks
madhan ravi
madhan ravi le 9 Nov 2018
Modifié(e) : madhan ravi le 9 Nov 2018
om = 4.0264e+05;
sd=.3.*om;
k3=0.01;
ld=0.085;
c0=@(a)-(om.^2+(3./4).*k3.*a.^2).*sd.^2+(om.^2+(3./4).*k3.*a.^2).*(om.^2+(3./4).*k3.*a.^2+ld.^2+2.*y.*ld+(3./2).*k3.*a.^2);
c1=@(a)2.*(om.^2+(3./4).*k3.*a.^2).*(2.*y+ld)+2.*y.*(ld.^2+2.*y.*ld+(3./2).*k3.*a.^2);
c2=@(a)2.*(om.^2+(3./4).*k3.*a.^2)+(3./2).*k3.*a.^2+ld.^2+4.*y.^2+6.*y.*ld;
c3=2.*(2.*y+ld);
b1=@(dm)-2.*dm.*om.*(y+ld);
b2=@(a,dm)(om.^2+(3./4).*k3.*a.^2)+(3./2).*k3.*a.^2+ld.^2+2.*y.*ld-(dm.*om).^2;
eq=@(a,dm)sqrt((b1(dm).^2+b2(a,dm).^2)./(((dm.*om).^4-c2(a).*(dm.*om).^2+c0(a)).^2+(c3.*(dm.*om).^3-c1(a).*dm.*om).^2))-a;
a=linspace(1,3,1000); %fake data
m=linspace(0,3,1000);
plot(eq(a,m))
whats y value?
T S Singh
T S Singh le 9 Nov 2018
Can I take "dm" (say m=linspace(0,3,1000)) the independent variable and calculate the corresponding "a" (dependent variable) and plot??
madhan ravi
madhan ravi le 9 Nov 2018
yes

Connectez-vous pour commenter.

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by