How can I fix this error?

조회 수: 3 (최근 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