please help me !!!

3 vues (au cours des 30 derniers jours)
Nguyen Quoc Khanh
Nguyen Quoc Khanh le 10 Mai 2022
Commenté : Jan le 20 Mai 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

Réponses (1)

DGM
DGM le 10 Mai 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 commentaires
Torsten
Torsten le 20 Mai 2022
What is "SP" ? A function ? I can't find it.
Jan
Jan le 20 Mai 2022
Please post the complete error message.
What is "SP"?

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by