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

2 vues (au cours des 30 derniers jours)
Ans Flew
Ans Flew le 2 Mar 2020
Commenté : Ans Flew le 3 Mar 2020
t= linspace(0,6,100);
y=sin(pi*t);
plot(t,y)
  1 commentaire
Ans Flew
Ans Flew le 3 Mar 2020
I want it to be from 0 to 6 and the number of digits 100 and not 5000

Connectez-vous pour commenter.

Réponse acceptée

Stephan
Stephan le 2 Mar 2020
Modifié(e) : Stephan le 2 Mar 2020
More resolution for the values + logical indexing:
t= linspace(0,6,5000);
y=sin(pi*t);
plot(t(y>=0),y(y>=0))

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by