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

 Risposta accettata

Stephen23
Stephen23 il 22 Ott 2020
Modificato: Stephen23 il 22 Ott 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;

Più risposte (0)

Categorie

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by