how to calculate the value from function define

조회 수: 1 (최근 30일)
shiv gaur
shiv gaur 2022년 2월 16일
댓글: Walter Roberson 2022년 2월 16일
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개)

카테고리

Help CenterFile Exchange에서 Stress and Strain에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by