How to produce line plot yline for matlab R2018a
조회 수: 16 (최근 30일)
이전 댓글 표시
Hello,
My computer has R2018a old version software, I do not have time to download it.
I want to add in the graph a line in y=260, How to do and there is a special code for it?
Thanks for the helpers
yline(260,'--r','Ground'); %No work
댓글 수: 0
채택된 답변
madhan ravi
2021년 1월 5일
편집: madhan ravi
2021년 1월 5일
Start = 0; % sorry I completely misinterpreted the question xD
End = 1;
Point = 260;
plot(linspace(Start, End, 1e2), repelem(Point, 1e2), '--r')
text(End - .11, Point + .07, 'Ground', 'Color', 'r')
댓글 수: 0
추가 답변 (2개)
William
2021년 1월 5일
It's not really necessary to plot 100 points along the line. The first and last points are enough, as in:
plot([0,1],[260,260],'--r');
madhan ravi
2021년 1월 5일
Funny thing , i did a file exchange a while ago for passing time, not the efficient one but gets the job done ;)
댓글 수: 2
madhan ravi
2021년 1월 5일
편집: madhan ravi
2021년 1월 5일
start_point = -260/2;
end_point = 260/2;
plot(260*ones(1e2, 1), linspace(start_point, end_point, 1e2), '--r')
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!