Delete points from a graph

조회 수: 6 (최근 30일)
Zenplay
Zenplay 2022년 2월 2일
댓글: KSSV 2022년 2월 2일
Hello everyone, I am a beginner on matlab.
I would like to remove the part of my signal that is at 0.
Here is my program :
f=100;
t1=1/f;
t=0:t1:1;
x=sin(2*pi*3*t);
fe=22;
te=1/fe;
ta=0:te:1;
xe=sin(2*pi*3*ta);
tf=0:t1:1;
xrect=rectpuls(tf,2*1/3);
subplot(2,1,1);
stem(ta,xe,'b');
hold on;
plot(t,x);
plot(tf,xrect,'black');
hold off;
grid on;
subplot(2,1,2);
C=times(x,xrect);
plot(t,C);
grid on;
Thank you in advance for your answers.

채택된 답변

KSSV
KSSV 2022년 2월 2일
idx = C~=0 ;
plot(t(idx),C(idx));
grid on;
  댓글 수: 1
KSSV
KSSV 2022년 2월 2일
@Zenplay commented: Thank you for your answer KSSV :) It works perfectly !

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by