r2n.m

来自「用matlab编写的电磁学方面的函数和图像」· M 代码 · 共 27 行

M
27
字号
% r2n.m - reflection coefficients to refractive indices of M-layer structure
%
% Usage: n = r2n(r)
%
% r = reflection coefficients = [r(1),...,r(M+1)]
% n = refractive indices = [na,n(1),...,n(M),nb] 
%
% notes: there are M layers, M+1 interfaces, and M+2 media

% S. J. Orfanidis - 1999 - www.ece.rutgers.edu/~orfanidi/ewa

function n = r2n(r)

if nargin==0, help r2n; return; end

M = length(r)-1;	% number of layers

n  = 1;
ni = 1; 

for i=1:M+1,
	ni = ni * (1-r(i))/(1+r(i));
	n = [n,ni];
end


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?