我的M文件如下:
n'ehB%" function [G5]=fun(x);
]u;GNz}? syms n1 n2 k1 k2 d;
rQn{L{ [subwave,nsub]=textread('subout.txt','%f %f');
QTeFR&q8 [filmwave,filmtran]=textread('filmtr.dat','%f %f');
^g-Fg>&M [p,q]=size(subwave);
YN4"O> for j=1:p;
w[e0wh`. wavel(j)=subwave(j,1);
<8g=BWA n(j)=n1+n2/((wavel(j))^2);
8g.AT@ ,Q k(j)=k1*exp(k2/wavel(j));
=?wMESU N(j)=n(j)-i*k(j);
m**0rpA phase(j)=2*pi*N(j)*d/wavel(j);
k?o^5@b/ ns(j)=nsub(j,1);
xQX<w\s B(j)=cos(phase(j))+ns(j)*i*sin(phase(j))/N(j);
@X