Say my input is a sine wave something like this :
Fs = 1000;
t = 0.001:1/Fs:1.005;
fm= 1;
u = sin(2*pi*fm*t)'
Now i need my input to start from 6th sample instead of 1st. u (1:5) =0; But when i run the code, my 6th sample is found to be u(6)= 0.0377 but i need my 6th sample to be 0.0063 which is u(1) before initialized to zero.
I mean i m not getting my sine wave to start at 6 th sample.. as the first 5 samples are not considered in my code (assigned to zero ).
Could any one help me with this ?

 채택된 답변

Mischa Kim
Mischa Kim 2014년 4월 4일

0 개 추천

Sai, use
u = sin(2*pi*fm*(t-t(6)))';
u(1:5) = 0;

댓글 수: 1

Sai kasyap
Sai kasyap 2014년 4월 4일
편집: Sai kasyap 2014년 4월 5일
Hey , if my input is randn instead of sine ! how to do it then ?

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2014년 4월 4일

편집:

2014년 4월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by