永发信息网

matlab高手们 看看这段程序 哪里出错了?? 提示:Error using pm (line 3) Not enough input argume

答案:2  悬赏:50  手机版
解决时间 2021-03-06 03:53
  • 提问者网友:捧腹剧
  • 2021-03-05 17:26
function retstr=pm(instruct,in)
retstr=char('');
cd(in.mldir);
tz=str2double(in.tz);
fc=str2double(in.fc);
t0=str2double(in.t0);
kf=str2double(in.kf);
t0=0.25;
val=str2double(in.val);
kf=50;
fz=1/tz;
t=[0:tz:t0];
df=0.25;
m=zeros(1,501);
for i=1:1:125
m(i)=i;
end
for i=126:1:375
m(i)=m(125)-i+125;
end
for i=376:1:501
m(i)=m(375)+i-375;
end
m=m/50;
[M,m,df1]=fftseq(m,tz,df);
M=M/fz;
k=[0:df1:df1*(length(m)-1)]-fz/2;
for i=1:length(t)
mn(i)=m(i);
end
u=cos(2*pi*fc*t+mn);
[U,u,df1]=fftseq(u,tz,df);
U=U/fz;
switch(val)
case(0)
f=figure('visible','off');
plot(t,m(1:length(t)))
axis([0,0.25,-3,3]);
xlabel('Time')
title('信号波形');
drawnow;
pic0=sprintf('%spic0.jpeg',in.mlid);
wsprintjpeg(f,pic0);
close(f);
out.pic0=pic0;
temfile=which('pm0.html');
retstr=htmlrep(out,temfile);
case(1)
f=figure('visible','off');
plot(t,u(1:length(t)))
axis([0,0.15,-2.1,2.1]);
xlabel('Time')
title('调相信号的时域波形');
drawnow;
pic1=sprintf('%spic1.jpeg',in.mlid);
wsprintjpeg(f,pic1);
close(f);
out.pic1=pic1;
temfile=which('pm1.html');
retstr=htmlrep(out,temfile);
case(2)
f=figure('visible','off');
plot(k,abs(fftshift(M)))
xlabel('频率(khz)');
title('信号频谱')
drawnow;
pic2=sprintf('%spic2.jpeg',in.mlid);
wsprintjpeg(f,pic2);
close(f);
out.pic2=pic2;
temfile=which('pm2.html');
retstr=htmlrep(out,temfile);
case(3)
f=figure('visible','off');
plot(k,abs(fftshift(U)))
title('调相信号的频谱')
xlabel('频率(khz)')
drawnow;
pic3=sprintf('%spic3.jpeg',in.mlid);
wsprintjpeg(f,pic3);
close(f);
out.pic3=pic3;
temfile=which('pm3.html');
retstr=htmlrep(out,temfile);
case(4)
f=figure('visible','off');
plot(t,m(1:length(t)))
axis([0,0.25,-3,3]);
xlabel('Time')
title('信号波形');
drawnow;
pic0=sprintf('%spic0.jpeg',in.mlid);
wsprintjpeg(f,pic0);
close(f);
out.pic0=pic0;
temfile=which('pm4.html');
retstr=htmlrep(out,temfile);
f=figure('visible','off');
plot(t,u(1:length(t)))
axis([0,0.15,-2.1,2.1]);
xlabel('Time')
title('调相信号的时域波形');
drawnow;
pic1=sprintf('%spic1.jpeg',in.mlid);
wsprintjpeg(f,pic1);
close(f);
out.pic1=pic1;
temfile=which('pm4.html');
retstr=htmlrep(out,temfile);
f=figure('visible','off');
plot(k,abs(fftshift(M)))
xlabel('频率(khz)');
title('信号频谱')
drawnow;
pic2=sprintf('%spic2.jpeg',in.mlid);
wsprintjpeg(f,pic2);
close(f);
out.pic2=pic2;
temfile=which('pm4.html');
retstr=htmlrep(out,temfile);
f=figure('visible','off');
plot(k,abs(fftshift(U)))
title('调相信号的频谱')
xlabel('频率(khz)')
drawnow;
pic3=sprintf('%spic3.jpeg',in.mlid);
wsprintjpeg(f,pic3);
close(f);
out.pic3=pic3;
temfile=which('pm4.html');
retstr=htmlrep(out,temfile);
end
最佳答案
  • 五星知识达人网友:污到你湿
  • 2021-03-05 19:02
直观上看好像是你调用的某个函数的输入参数不够,并且这个函数针对这个参数没有默认值。估计是调用了自己写的。呵呵。
全部回答
  • 1楼网友:猎心人
  • 2021-03-05 20:15
同问。。。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯