How can I produce a plot like the one in the picture using quadratic equation in MATLAB?

5 views (last 30 days)

Answers (1)

Star Strider
Star Strider on 29 Oct 2022
I have no idea what the picture demonstrates.
Perhaps something like this —
a = randn
a = -1.4245
b = randn
b = -0.7669
c = randn
c = 1.2477
r = roots([a b c])
r = 2×1
-1.2430 0.7047
fcn = @(x) a*x.^2 + b*x + c;
xinterval = [-10 10];
figure
fimplicit(fcn, xinterval, 'DisplayName','Function Roots')
yl = ylim;
hold on
fplot(fcn, xinterval, 'DisplayName','Function Plot')
hold off
ylim(yl)
grid
legend('Location','best')
.

Categories

Find more on Mathematics in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!