请问这段matlab程序哪里错了?clcclear allh=1;c=3*10^8; Eps0=10^-9/(36*pi);u0=4*pi*10^-7;epslona=5.5225;ua=1.0;na=epslona^0.5;a=2*pi*4.8797e-008;%a=120*7e-9;epslonb=1.9044;nb=epslonb^0.5;ub=1;b=2*pi*4.8797e-008;%ab=240*7e-9%nb=3.23;epslonb=nb^

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/29 19:28:20
请问这段matlab程序哪里错了?clcclear allh=1;c=3*10^8; Eps0=10^-9/(36*pi);u0=4*pi*10^-7;epslona=5.5225;ua=1.0;na=epslona^0.5;a=2*pi*4.8797e-008;%a=120*7e-9;epslonb=1.9044;nb=epslonb^0.5;ub=1;b=2*pi*4.8797e-008;%ab=240*7e-9%nb=3.23;epslonb=nb^
xURV 3I&#NL9GIOP(6i(1)Ӓ2ip Z_ +H)_E2AܗNT\Q A{]b!KFĴxEƢq$" RR3Rt+Ĵ$-6Pl"y𸜔WkЉg#7GRdT}B(wt\OxRacTtn*wkMi`ҁXS4#!_wKuA:,rMփF[GVZQ|nj'[,aI+\=Xp}"~}Wu?tVwznM$eaډI'5q#ӂǛ݃p~l9jO~l-_DZj6-!l>YpR҄iM2zx6dNߣ?x U|$CN<T%UIp

请问这段matlab程序哪里错了?clcclear allh=1;c=3*10^8; Eps0=10^-9/(36*pi);u0=4*pi*10^-7;epslona=5.5225;ua=1.0;na=epslona^0.5;a=2*pi*4.8797e-008;%a=120*7e-9;epslonb=1.9044;nb=epslonb^0.5;ub=1;b=2*pi*4.8797e-008;%ab=240*7e-9%nb=3.23;epslonb=nb^
请问这段matlab程序哪里错了?
clc
clear all
h=1;c=3*10^8; Eps0=10^-9/(36*pi);u0=4*pi*10^-7;
epslona=5.5225;ua=1.0;na=epslona^0.5;a=2*pi*4.8797e-008;%a=120*7e-9;
epslonb=1.9044;nb=epslonb^0.5;ub=1;b=2*pi*4.8797e-008;%ab=240*7e-9
%nb=3.23;epslonb=nb^2;ub=1;b=180/nb*h;na=1.0;epslona=na^2;ua=1.0;a=180/na*h;
d=a+b;
w0=pi*c/(na*a+nb*b);
k=0;
p=0;
for sigma1=(0:0.01:0.3)*pi;%入射角
p=p+1
for w=(0:0.01:3)*w0;
k=k+1
chain='ABABABABABABABABABABA';
m=[1,0
0,1];
for n=1:21
switch chain(n);
case('A');
deltaa=-w./c*sqrt(epslona)*a*cos(sigma1);
etaa=sqrt(Eps0*epslona/u0)*cos(sigma1);
mj=[cos(deltaa),-(i/etaa)*sin(deltaa)
-(i*etaa)*sin(deltaa),cos(deltaa)];
case('B');
deltab=-w./c*sqrt(epslonb)*b*cos(sigma1);
etab=sqrt(Eps0*epslonb/u0)*cos(sigma1);
mj=[cos(deltab),-(i/etab)*sin(deltab)
-(i*etab)*sin(deltab),cos(deltab)];
end
m=m*mj;
end
eta01=sqrt(Eps0)/sqrt(u0)*cos(sigma1);
etaN1=eta01;
t1=2/(m(1,1)+m(1,2).*etaN1+m(2,1)./eta01+m(2,2).*etaN1/eta01);
x=sigma1
y1(k)=w./w0;
end
z1(p)=abs(t1);
end
figure(1)
surf(x,y1,z1)
xlable('x');ylabel('w/w0');zlabel('transsimation');
显示结果为:warning:Matrix dimensions must agree,not rendering mesh.

请问这段matlab程序哪里错了?clcclear allh=1;c=3*10^8; Eps0=10^-9/(36*pi);u0=4*pi*10^-7;epslona=5.5225;ua=1.0;na=epslona^0.5;a=2*pi*4.8797e-008;%a=120*7e-9;epslonb=1.9044;nb=epslonb^0.5;ub=1;b=2*pi*4.8797e-008;%ab=240*7e-9%nb=3.23;epslonb=nb^

循环里面对x、y1、z1赋值部分搞的很乱,得到的结果根本无法绘制曲面.

另外xlable写错了.

我给改了一下,马马虎虎能用,算不上太好的做法.曲面的显示效果也做了一些调整.

 

代码已作为附件上传,效果图如下: