MATLAB Answers

how can I get y which correspond to x and then plot (x,y)??

1 view (last 30 days)
jameslk
jameslk on 16 Jun 2021
syms x y
x=[-4:1:4]
f = y^3+0.2*exp(-1*x^2)*y^2-2.2039*y^2+0.8155 == 0;

Answers (1)

Rafael Hernandez-Walls
Rafael Hernandez-Walls on 16 Jun 2021
Try this:
x=linspace(-4,4);
for r=1:length(x)
y(r)=fzero(@(y)y.^3+0.2*exp(-1*x(r).^2)*y.^2-2.2039*y.^2+0.8155,1);
end
plot(x,y)

Categories

Community Treasure Hunt

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

Start Hunting!

Translated by