please help me !!!

9 visualizzazioni (ultimi 30 giorni)
Nguyen Quoc Khanh
Nguyen Quoc Khanh il 10 Mag 2022
Commentato: Jan il 20 Mag 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

Risposte (1)

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

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by