how to calculate the value from function define

la0 = 650; k0 = 2*%pi/la0; ef = 1; ec = -19.6224-0.443*%i; es=ec;
pc = ef/ec; ps = ef/es;
bcinf = sqrt(ec*ef/(ec+ef));
tol = 1e-12;
acut = -real(1/pc/sqrt(ef-ec))/k0;
wc = 2*acut;
nc = sqrt(ef);
w = 5:10:3500; //% thickness range for TM0
w1 = 1.001*wc:10:3500; //% thickness range for TM1
function be=f(la0, ef, ec, w, bcinf, m, tol);
for j=1:length(w)
be(j) = f(la0,ef,ec,w(j),bcinf,0,tol);
end
for j=1:length(w1)
be1(j) = f(la0,ef,ec,w1(j),bcinf,1,tol);
end
neff0 = real(be0); L0 = -1/2./imag(be0)/k0/1000; //% TM0 index & distance
neff1 = real(be1); L1 = -1/2./imag(be1)/k0/1000;// % TM1 index & distance
w2=1000; a = w2/2;// % specific solutions
b = f(la0,ef,ec,a,bcinf,0,tol);// % TM0
p = f(la0,ef,ec,a,bcinf,1,tol);// % TM1
neff02 = real(be02); L02 = -1/2/imag(be02)/k0/1000;
end
disp(be,b,p)
pl help to solve the problem to disp(be,b,p)

1 件のコメント

Walter Roberson
Walter Roberson 2022 年 2 月 16 日
Your function f calls itself multiple times, and does so unconditionally. That is an infinite loop.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

製品

リリース

R2021b

タグ

質問済み:

2022 年 2 月 16 日

コメント済み:

2022 年 2 月 16 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by