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

1 view (last 30 days)
t= linspace(0,6,100);
y=sin(pi*t);
plot(t,y)

Accepted Answer

Stephan
Stephan on 2 Mar 2020
Edited: Stephan on 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))

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!