我的这个在MATLAB上为什么会出错,求高人clear
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/11 00:15:53
我的这个在MATLAB上为什么会出错,求高人clear
clear
f1p=fopen('D:temp2\chirp_t13.dat','w+');
f2p=fopen('D:temp2\chirp_t14.dat','w+');
N=1000;
t0=80;%高斯脉宽取值为80ps
bc=-3;b2=16;b3=0.1;
z=linspace(0,1000,N);
z0=z;y=z;y1=z;y2=z;y3=z;y4=z;
Vw=0;%
for j=1:N
z0=z/400;
y(j)=sqrt((1+0*0*z(j)/t0^2)^2+(1+Vw^2)*(0*z(j)/t0^2)^2+(1+0^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y1(j)=sqrt((1+0*b2*z(j)/t0^2)^2+(1+Vw^2)*(b2*z(j)/t0^2)^2+(1+0^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y2(j)=sqrt((1+bc*0*z(j)/t0^2)^2+(1+Vw^2)*(0*z(j)/t0^2)^2+(1+bc^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y3(j)=sqrt((1+bc*b2*z(j)/t0^2)^2+(1+Vw^2)*(b2*z(j)/t0^2)^2+(1+bc^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
fprintf(f1p,'% f % e % e % e % e\n',z0(j),y(j),y1(j),y2(j),y3(j));
end
figure(1);
clear
f1p=fopen('D:temp2\chirp_t13.dat','w+');
f2p=fopen('D:temp2\chirp_t14.dat','w+');
N=1000;
t0=80;%高斯脉宽取值为80ps
bc=-3;b2=16;b3=0.1;
z=linspace(0,1000,N);
z0=z;y=z;y1=z;y2=z;y3=z;y4=z;
Vw=0;%
for j=1:N
z0=z/400;
y(j)=sqrt((1+0*0*z(j)/t0^2)^2+(1+Vw^2)*(0*z(j)/t0^2)^2+(1+0^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y1(j)=sqrt((1+0*b2*z(j)/t0^2)^2+(1+Vw^2)*(b2*z(j)/t0^2)^2+(1+0^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y2(j)=sqrt((1+bc*0*z(j)/t0^2)^2+(1+Vw^2)*(0*z(j)/t0^2)^2+(1+bc^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y3(j)=sqrt((1+bc*b2*z(j)/t0^2)^2+(1+Vw^2)*(b2*z(j)/t0^2)^2+(1+bc^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
fprintf(f1p,'% f % e % e % e % e\n',z0(j),y(j),y1(j),y2(j),y3(j));
end
figure(1);
我改了几处明显的语法错误,个别地方还出现了中文标点,也改过来了.运行正常,但是我不知道你的数据的现实意义,所以没有修改任何实质性的地方:
clear
f1p=fopen('D:\temp2\chirp_t13.dat','w+');
f2p=fopen('D:\temp2\chirp_t14.dat','w+');
N=1000;
t0=80;%高斯脉宽取值为80ps
bc=-3;b2=16;b3=0.1;
z=linspace(0,1000,N);
z0=z;y=z;y1=z;y2=z;y3=z;y4=z;
Vw=0;%
z0=z/400;
for j=1:N
y(j)=sqrt((1+0*0*z(j)/t0^2)^2+(1+Vw^2)*(0*z(j)/t0^2)^2+(1+0^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y1(j)=sqrt((1+0*b2*z(j)/t0^2)^2+(1+Vw^2)*(b2*z(j)/t0^2)^2+(1+0^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y2(j)=sqrt((1+bc*0*z(j)/t0^2)^2+(1+Vw^2)*(0*z(j)/t0^2)^2+(1+bc^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y3(j)=sqrt((1+bc*b2*z(j)/t0^2)^2+(1+Vw^2)*(b2*z(j)/t0^2)^2+(1+bc^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
fprintf(f1p,'% f % e % e % e % e\n',z0(j),y(j),y1(j),y2(j),y3(j));
end
figure(1);
clear
f1p=fopen('D:\temp2\chirp_t13.dat','w+');
f2p=fopen('D:\temp2\chirp_t14.dat','w+');
N=1000;
t0=80;%高斯脉宽取值为80ps
bc=-3;b2=16;b3=0.1;
z=linspace(0,1000,N);
z0=z;y=z;y1=z;y2=z;y3=z;y4=z;
Vw=0;%
z0=z/400;
for j=1:N
y(j)=sqrt((1+0*0*z(j)/t0^2)^2+(1+Vw^2)*(0*z(j)/t0^2)^2+(1+0^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y1(j)=sqrt((1+0*b2*z(j)/t0^2)^2+(1+Vw^2)*(b2*z(j)/t0^2)^2+(1+0^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y2(j)=sqrt((1+bc*0*z(j)/t0^2)^2+(1+Vw^2)*(0*z(j)/t0^2)^2+(1+bc^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
y3(j)=sqrt((1+bc*b2*z(j)/t0^2)^2+(1+Vw^2)*(b2*z(j)/t0^2)^2+(1+bc^2+Vw^2)*(b3*z(j)/(2*t0^3))^2);
fprintf(f1p,'% f % e % e % e % e\n',z0(j),y(j),y1(j),y2(j),y3(j));
end
figure(1);