Adding a horizontal line to a plot

2 ビュー (過去 30 日間)
Cullen McGee
Cullen McGee 2018 年 3 月 13 日
編集済み: Matt J 2018 年 3 月 13 日
Im trying to add a line at y=0 through the root of the function but for some reason I cant get it to work. This is what I have. If anyone could help that would be great.
f1=@ (x) exp(.5.*x)-sqrt(x)-3;
p01r=fzero(f1,3.1)
c=[0:5];
figure
fplot(f1,[1 5]);
hold on
plot(3.1236,0,'or');
plot(c,0);
hold off

回答 (1 件)

Matt J
Matt J 2018 年 3 月 13 日
plot(c, zeroes(size(c)))

カテゴリ

Help Center および File ExchangeOptimization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by