How to change length of an input signal? signal X in below example?

조회 수: 2 (최근 30일)
Syed Adeel
Syed Adeel 2020년 4월 13일
댓글: David Hill 2020년 4월 13일
Hello everyone
Below is code that i want to run for different duration. What actually effects the lenght in below code. I thought N changes number of code bit it does not changes with any value of N. If i have to run it for long what should i change?
Code is pasted in above line. Thats how time is defined in my long code. Last two lines dummy plot just to show signal.
  댓글 수: 2
Akira Agata
Akira Agata 2020년 4월 13일
What does the following two lines in your code mean?
These lines must return error.
wu 1.2868e + = 04;
and
time = time T * / N;
Syed Adeel
Syed Adeel 2020년 4월 13일
편집: Syed Adeel 2020년 4월 13일
I dont know why some symbols change when i save my posts. Its wu = 1.2868e + 04; and time = T * time / N;
wu 1.2868e + = 04;
T = 10 / wu;
N = 200;
time = 1: 1: N;
time = time T * / N;
% above is how time is defined in my long code, i cant change
% below is just a random signal defined to show
x = sin (2 * 8000 * time);
plot (time, x);

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

채택된 답변

David Hill
David Hill 2020년 4월 13일
wu=1.2868e4;
T=20/wu;%change T
N=200;
t=1:N;
t=T*t/N;
x=sin(16000*t);
plot(t,x);
  댓글 수: 2
Syed Adeel
Syed Adeel 2020년 4월 13일
Thankyou for your reply.
I tried that before and it works. Why doesnt N works here? Can you comment
David Hill
David Hill 2020년 4월 13일
Because you divide by N. Combining your three equations:
t=20/wu*(1:N)/N;

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by