How can I fix this error?

3 visualizaciones (últimos 30 días)
Kwan Ho NG
Kwan Ho NG el 30 de Mzo. de 2021
Comentada: Kwan Ho NG el 30 de Mzo. de 2021
  2 comentarios
James Tursa
James Tursa el 30 de Mzo. de 2021
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 el 30 de Mzo. de 2021
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)

Iniciar sesión para comentar.

Respuestas (1)

James Tursa
James Tursa el 30 de Mzo. de 2021
Delete the extra closing parentheses. I.e., delete the paren where the red underline is.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by