Plotting two variables, getting graph and x intercept
Ältere Kommentare anzeigen
I need to plot the equation :
0 = x^3 + 6x^2 + 4(1 - y^2)
The variable y needs to take values 0, 1, 2, 3, 4. I'm wondering if there is a loop I can do for this.
I would also like to get the x-intercepts as an output.
Is there a way to plot them on single graphs and all on the same graph?
Akzeptierte Antwort
Weitere Antworten (1)
Alan Stevens
am 27 Aug. 2020
Here's an alternative
f = @(x,y) x.^3 + 6*x.^2 + 4*(1-y.^2);
coeff = @(y) [1 6 0 4*(1-y.^2)];
y = 0:4;
for i = 1:length(y)
R(:,i) = roots(coeff(y(i)));
end
ezplot(f)
1 Kommentar
M K
am 27 Aug. 2020
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!