![]() |
在运行是会出现Error: Missing variable or function.是怎么回事啊?请帮帮我!
在运行一下程序是会出现Error: Missing variable or function.是怎么回事啊?
display('Please input the value of m(傅立叶级数展开的项数)'); m=input('m='); t=-2*pi:0.01:2*pi; n=round(length(t)/4); f=[ones(n,1);-1*ones(n,1);ones(n,1);-1*ones(n+1,1)]; y=zeros(m+1,mas(size(t))); y(m+1,:)=f'; figure(1); plot(t/pi,y(m+1,:)); grid; axis([-2 2 -1.5 1.5]); title('周期方波'); xlable('单位': pi','Fontsize',8); x=zeros(size(t)); kk='1'; for k=1:2:2*m-1 pause; x=x+sin(k*t)/k; y((k+1)/2,:)=4/pi*x; plot(t/pi,y(m+1,:)); hold on; plot(t/pi,y((k+1)/2,:)); hold off; grid; axis([-2 2 -1.5 1.5]); title(strcat('第',kk,'次谐波叠加')); xlabel('单位': pi','Fontsize',8); kk=strcat(kk,'、',num2str(k+2)); end pause; plot(t/pi,y(1:m+1,:)); grid; axis([-2 2 -1.5 1.5]); title('各次谐波叠加波形'); xlabel('单位: pi','Fontsize',8); |
第6行
y=zeros(m+1,[COLOR="Red"]mas[/COLOR](size(t)));[COLOR="red"]max??[/COLOR] 凡是程序出错,matlab都会提供详细的错误说明,是可以定位到具体语句的哦,仔细阅读错误提示应该不难找出问题的。 |
所有时间均为北京时间。现在的时间是 08:42。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.