how do i plot til some x one function and then other

 Respuesta aceptada

Stephen23
Stephen23 el 22 de Oct. de 2020
Editada: Stephen23 el 22 de Oct. de 2020
x = 0:0.1:20;
y = min(12,x);
plot(x,y,'-+')
In a more general case, use logical indexing, e.g.:
x = 0:0.1:20;
y = x;
y(y>12) = 12;

Más respuestas (0)

Categorías

Más información sobre Line Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 22 de Oct. de 2020

Comentada:

el 22 de Oct. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by