How can I make the wave in the negative part disappear?

1 visualización (últimos 30 días)
Ans Flew
Ans Flew el 2 de Mzo. de 2020
Comentada: Ans Flew el 3 de Mzo. de 2020
t= linspace(0,6,100);
y=sin(pi*t);
plot(t,y)
  1 comentario
Ans Flew
Ans Flew el 3 de Mzo. de 2020
I want it to be from 0 to 6 and the number of digits 100 and not 5000

Iniciar sesión para comentar.

Respuesta aceptada

Stephan
Stephan el 2 de Mzo. de 2020
Editada: Stephan el 2 de Mzo. de 2020
More resolution for the values + logical indexing:
t= linspace(0,6,5000);
y=sin(pi*t);
plot(t(y>=0),y(y>=0))

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by