How can I fix this error?

1 次查看(过去 30 天)
Kwan Ho NG
Kwan Ho NG 2021-3-30
评论: Kwan Ho NG 2021-3-30
  2 个评论
James Tursa
James Tursa 2021-3-30
In the future, always post your code as text highlighted by the CODE button. Do not post your code as images because we can't copy & run pictures.
Kwan Ho NG
Kwan Ho NG 2021-3-30
clear;
fs=10^4;
fc=1000; %carrier frequency
T=16*(1/500); %1/500 is the bit duration; 16bits data
Ts=1/fs; %Ts is the sampling duration for a given frequency = 0.0001s
N=T/Ts; %total number of samples for the 16 bit data
sin_wave= sin(2*pi*fc*(0:Ts:(N-1)*Ts));
cos_wave= cos(2*pi*fc*(0:Ts:(N-1)*Ts));
Ns=40;
data_I=[1 1 1 1 1 -1 1 -1];
data_Q=[-1 -1 1 1 -1 1 -1 -1];
sum_unm=8;
for i=1:sum_unm
for j=1:Ns
data_I_exit((i-1)*Ns+j))=data_I(i);
data_Q_exit((i-1)*Ns+j))=data_Q(i);
end;
end;
for i=1:N
out_QPSK(i)=data_I_exit(i)*cos_wave(i)+data_I_exit(i)+cos_wave(i);
end;
x=0:Ts:T-Ts
plot(x,out_QPSK)

请先登录,再进行评论。

回答(1 个)

James Tursa
James Tursa 2021-3-30
Delete the extra closing parentheses. I.e., delete the paren where the red underline is.

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by