Clear Filters
Clear Filters

Plotting straight line on graph

18 views (last 30 days)
Zane  Wilkinson
Zane Wilkinson on 5 Aug 2015
Answered: Vedangi Gholap on 16 Oct 2023
Hey easy question but how do i plot the line y=40 in matlab? What is the script i need to write?
Thanks zane :)

Accepted Answer

Simon
Simon on 15 Oct 2023
Moved: Matt J on 15 Oct 2023
yline(40)
  1 Comment
Dyuman Joshi
Dyuman Joshi on 15 Oct 2023
Note that yline is available from R2018b onwards.
In case of an older version, use the method described in the other answer.

Sign in to comment.

More Answers (2)

Walter Roberson
Walter Roberson on 5 Aug 2015
plot([first_x last_x], 40)

Vedangi  Gholap
Vedangi Gholap on 16 Oct 2023
plot([0 3], [40,40])

Community Treasure Hunt

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

Start Hunting!