How do I draw a horizontal line at a fixed height on the y axis and print the coordinates of the points I intercept?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I have a matlab plot with 6 curves (or functions).
My y-axis ranges from 0 to 255.
My x-axis ranges from -20 to 20.
How do I "draw" a horizontal line (for example y = 80) and the points it intercepts, print the coordinates and which function they refer to. The functions are differentiated in the legend by colors and names.
0 Kommentare
Antworten (1)
KSSV
am 11 Okt. 2021
th = linspace(0,2*pi) ;
x = sin(th) ;
plot(th,x)
hold on
line([th(1) th(end)],[0.4 0.4])
For finding intersections use: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots 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!