How to find the Intersection between curves and yline ?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jenifer NG
am 22 Aug. 2022
Kommentiert: Jenifer NG
am 22 Aug. 2022
Hi All,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1103770/image.jpeg)
Could Anyone please help me ?
This is my code:
load matlab
lst = {'0.54','0.55','0.56','0.57','yline'}
plot(m4)
yline(0.1,LineWidth=1.5,LineStyle="--")
legend(lst)
Thanks and Regard!
Han
0 Kommentare
Akzeptierte Antwort
Chunru
am 22 Aug. 2022
Bearbeitet: Chunru
am 22 Aug. 2022
load matlab
lst = {'0.54','0.55','0.56','0.57','yline'}
plot(m4)
yline(0.1,LineWidth=1.5,LineStyle="--")
legend(lst)
for i=1:size(m4, 2)
F = griddedInterpolant(1:size(m4, 1), m4(:, i));
[~, x0] = min(abs(m4(:, i) - 0.1)); % coarse estimate
x(i) = fsolve(@(x) F(x)-0.1, x0); % finer solution
end
x
hold on
xline(x)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!