please help me !!!

5 views (last 30 days)
Nguyen Quoc Khanh
Nguyen Quoc Khanh on 10 May 2022
Commented: Jan on 20 May 2022
fs=8e3; % tần số lấy mẫu
step=1/fs; % chu kỳ lấy mẫu
A=87.6; % hằng số nén luật A
t=0:step:1; %vecto thời gian- quá trình lấy mẫu
Pa=-14:28/255:14; % vecto các mức lượng tử hóa, biên độ lớn nhất và nhỏ nhất có thể của s(t) là 14 và -14
s(t)=(1*cos(2*pi*100*t))+(2*cos(2*pi*200*t+pi/2))+(3*cos(2*pi*200*t+pi/4)); % quá trình lấy mẫu
Array indices must be positive integers or logical values.
Error in untitled2 (line 8)
s(t)=(1*cos(2*pi*100*t))+(2*cos(2*pi*200*t+pi/2))+(3*cos(2*pi*200*t+pi/4)); % quá trình lấy mẫu

Answers (1)

DGM
DGM on 10 May 2022
As mentioned in the comment you left,
t is not a nonzero integer, so you can't use it as an index on the LHS of the assignment.
s = cos(2*pi*100*t) + 2*cos(2*pi*200*t+pi/2) + 3*cos(2*pi*200*t+pi/4); % quá trình lấy mẫu
  3 Comments
Torsten
Torsten on 20 May 2022
What is "SP" ? A function ? I can't find it.
Jan
Jan on 20 May 2022
Please post the complete error message.
What is "SP"?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!