Borrar filtros
Borrar filtros

How do I plot a horizontal line

4 visualizaciones (últimos 30 días)
Alex Vasin
Alex Vasin el 9 de Abr. de 2019
Respondida: madhan ravi el 9 de Abr. de 2019
s=0.5:0.001:1;
f=yline(0.25);
plot(s,f)
How do I get this to produce a horizontal line at y=0.25 for the interval 0.5 <= s <= 1? Every time I run the script I get a blank graph.
Thanks

Respuesta aceptada

KSSV
KSSV el 9 de Abr. de 2019
s=0.5:0.001:1;
f=repmat(0.25,1,length(s));
plot(s,f)

Más respuestas (1)

madhan ravi
madhan ravi el 9 de Abr. de 2019

Using plot here is pointless when you can directly:

yline(.25)
xlim([.5,1])

Categorías

Más información sobre Labels and Annotations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by