Plotting a line through 2 points
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dennis
am 1 Okt. 2013
Kommentiert: Image Analyst
am 15 Sep. 2020
Hello,
I have a file with a difference in acceleration between 2 conditions, filename is 'ad'. I need to draw a line through 25% and 75% of the max of this data and then find the x-position where this line intercepts the x-axis.
Any help is appreciated, thanks.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 1 Okt. 2013
Use the line() function. Just figure out the two endpoints, which shouldn't be very hard at all. Use "hold on" before you call line() so that you don't blow away the curve.
5 Kommentare
ErnestoE
am 15 Sep. 2020
Does this works for vertical lines too? i.e. if both values of x is the same?
Image Analyst
am 15 Sep. 2020
Yes. Just try it. And there is a new function xline() if you want the line to run all the way across the entire distance in y, instead of just between two points inside the axes.
xline(xLeft, 'Color', 'r', 'LineWidth', 3);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Object Properties 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!