关于matlab的代码问题,运行出错,求高手解答?代码如下,菜鸟在线等待。。。。。。。
echoont0=.15;ts=0.0005;fc=200;kf=50;fs=1/ts;t=[0:ts:t0];fs=0.25;%messagesignalm=[ones...
echo on
t0=.15;
ts=0.0005;
fc=200;
kf=50;
fs=1/ts;
t=[0:ts:t0];
fs=0.25;
%message signal
m=[ones(1,t0/(3*ts)),-2*ones(1,t0/(3*ts)),zeros(1,t0/(3*ts)+1)];
int_m(1)=0;t=[0:ts:t0];
for i=1:length(t)-1
int_m(i+1)=int_m(i)+m(i)*ts;
echo off;
end
echo on;
[M,md,f1]=fftseq(m,ts,df);
M=M/fs;
f=[0:df1:df1*(length(m)-1)]-fs/2;
u=cos(2*pi*fc*t+2*pi*kf*int_m);
[U,udf1]=fftseq(u,ts,df);
U=U/fs;
pause % press any key to see a plot of the message and modulated signal
subplot(2,1,1)
plot(t,m(1:length(1)))
axis([0 0.15 -2.1 2.1])
xlabel("Time')
tile("the message singal")
subplot(2,1,2)
plot(t,u(1:length(t)))
axis([0 0.5-2.1 2.1])
xlable("time')
title('magnitude spectrum of the modulated signal')
suplot(2,1,2)
plot(f,abs(fftshift(U)))
title('magnitude spectrum of the modulated signal')
label('frequency')
??? for i=1:length(t)-1
|
Error: Missing variable or function. 展开
t0=.15;
ts=0.0005;
fc=200;
kf=50;
fs=1/ts;
t=[0:ts:t0];
fs=0.25;
%message signal
m=[ones(1,t0/(3*ts)),-2*ones(1,t0/(3*ts)),zeros(1,t0/(3*ts)+1)];
int_m(1)=0;t=[0:ts:t0];
for i=1:length(t)-1
int_m(i+1)=int_m(i)+m(i)*ts;
echo off;
end
echo on;
[M,md,f1]=fftseq(m,ts,df);
M=M/fs;
f=[0:df1:df1*(length(m)-1)]-fs/2;
u=cos(2*pi*fc*t+2*pi*kf*int_m);
[U,udf1]=fftseq(u,ts,df);
U=U/fs;
pause % press any key to see a plot of the message and modulated signal
subplot(2,1,1)
plot(t,m(1:length(1)))
axis([0 0.15 -2.1 2.1])
xlabel("Time')
tile("the message singal")
subplot(2,1,2)
plot(t,u(1:length(t)))
axis([0 0.5-2.1 2.1])
xlable("time')
title('magnitude spectrum of the modulated signal')
suplot(2,1,2)
plot(f,abs(fftshift(U)))
title('magnitude spectrum of the modulated signal')
label('frequency')
??? for i=1:length(t)-1
|
Error: Missing variable or function. 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询