hi..
im writing a code to design a multilayer optical filter, the code goes like this:
i have N layers where each of them is described using a characteristic matrix m, and the resulting matrix for the whole structure is M=Πm from the first layer to the last one..
i wrote the code but theres sth. wrong it keeps telling me wrong using vertcat !!
can anyone take a look at it and tell me what is the prob. 'coz i can't find it..
and one more thing: how can i change the extension of a matlab file .m ??
*********************************************
for w=w %w=1000:2000 wavelength
M=[1 0;01];
d= ones(1,Nmax)*wc/4; %d:thickness of layer
%n layers each defined by m
for i=1:Nmax
if mod (i,2)==0
ni=nH;
else
ni=nL;
end
g=(2*pi*ni*d1i)/w; %M: the charactarestic matrix of all
%g=phase layers = multiplication of
m for each layer
m11=cos(g);
m12=(sin(g))/ni;
m21=ni*sin(g);
m22=cos(g);
M=M*[m11 i*m12;m21 m22];
end
t=2*n0/(((M(1)+i*M(3)*ns)*n0)+(i*M(2)+M(4)*ns));
%t=fractional transmission
tstar=conj(t);
T=t.*tstar.*(ns/n0);
R=1-T;
end
plot(R)
axis([wmin wmax 0 1])