How to find the intersection point by plotting the red line like below?

1 回表示 (過去 30 日間)
Ming Yin Tang
Ming Yin Tang 2020 年 2 月 13 日
編集済み: Jon 2020 年 2 月 13 日
how to add line and find y value like this if x is 0.1? like this
thanks

回答 (1 件)

Jon
Jon 2020 年 2 月 13 日
編集済み: Jon 2020 年 2 月 13 日
Assuming you have the water level in a vector, lets call it h, along with the values of pExceed in another vector, you can interpolate to estimate the level when pExceed equals 0.1
Somthing like
hInterp = interp1(pExceed,h,0.1);
You could then plot the data
plot(pExceed,h,'-b',0.1,hInterp,'*r')
If you want the horizontal and vertical red line you can plot the box with a bar plot, so
plot(pExceed,h,'-b',0.1,hInterp,'*r')
hold on
% make a single bar, bar is centered midway between 0 and 0.1 and has a width of 0.1 to get
% the effect you want
bar(0.1/2,hInterp,0.1,'FaceColor','none','EdgeColor','red')
hold off

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by