How can i solve "Subscript indices must either be real positive integers or logicals." error.

1 view (last 30 days)
Hello. I am trying to demodulate a signal.But i get Subscript indices must either be real positive integers or logicals error.I try debugging and i think the problem caused by s(t) part but i can not fix it.Can you help me to fix it? Many Thanks.
Ac=5;
fc=250;
fs=600;
Ta=1/fc;
t=1:0.01:10;
ym=Ac*sin(2*pi*fc*t);
k=0.85;
figure
plot(t,ym);
A = zeros(1,5995);
s(t)=Ac*(1+k*ym).*cos(2*pi*fc*t);
x = demod(s,fc,fs,'fm','centered');
figure
plot(x);

Accepted Answer

Torsten
Torsten on 18 May 2017
s=Ac*(1+k*ym).*cos(2*pi*fc*t);
Best wishes
Torsten.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!