Plotting straight line on graph

Hey easy question but how do i plot the line y=40 in matlab? What is the script i need to write?
Thanks zane :)

 Risposta accettata

Simon
Simon il 15 Ott 2023
Spostato: Matt J il 15 Ott 2023

0 voti

yline(40)

1 Commento

Note that yline is available from R2018b onwards.
In case of an older version, use the method described in the other answer.

Accedi per commentare.

Più risposte (2)

plot([first_x last_x], 40)

2 Commenti

Simon
Simon il 15 Ott 2023
this does not work
plot([first_x last_x], [40,40])

Accedi per commentare.

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by