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

조회 수: 2 (최근 30일)
Ans Flew
Ans Flew 2020년 3월 2일
댓글: Ans Flew 2020년 3월 3일
t= linspace(0,6,100);
y=sin(pi*t);
plot(t,y)
  댓글 수: 1
Ans Flew
Ans Flew 2020년 3월 3일
I want it to be from 0 to 6 and the number of digits 100 and not 5000

댓글을 달려면 로그인하십시오.

채택된 답변

Stephan
Stephan 2020년 3월 2일
편집: Stephan 2020년 3월 2일
More resolution for the values + logical indexing:
t= linspace(0,6,5000);
y=sin(pi*t);
plot(t(y>=0),y(y>=0))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by