how to plot roots with a value used in the function?
67 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Brian S.
am 23 Okt. 2019
Kommentiert: Brian S.
am 23 Okt. 2019
I'm pretty new to matlab so sorry if this question seems trivial.
My function is y = x^2 + bx -20. Im trying to find the roots for when b = 0 to 10 then plot the roots as a function of b.
So far Ive tried to do somethin like this but the graph comes up empty.
for b = 0:10
p = [1 b -20];
r = roots(p)
plot(r, b)
end
Suggestions? Any help is great thanks
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 23 Okt. 2019
for b = 0:10
p = [1 b -20];
r = roots(p);
plot(b, r, 'k*');
hold on
end
hold off
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Performance finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!