Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to calculate the value from program

조회 수: 1 (최근 30일)
shiv gaur
shiv gaur 2022년 2월 16일
마감: Rik 2022년 2월 16일
ef = 1.5^2; ec = -2^2; es = -1.8^2;
k0 = 1; a = 0.63; pc = ef/ec; ps = ef/es; binit = 0.5*sqrt(ef);
kf = sqrt(ef-binit^2);
as = sqrt(binit^2-es);
ac = sqrt(binit^2-ec);
tol = 1e-12; n = 1;
while 1
kf_new = (atan(-kf/ac/pc)+atan(-kf/as/ps))/2/a;
if abs(kf_new-kf) < tol, break; end
kf = kf_new;
be = sqrt(ef - kf^2);
as = sqrt(be^2 - es); %c % edit Rik: assuming this is a typo
ac = sqrt(be^2 - ec);
n=n+1;
end
E = abs(tan(2*k0*a*kf) - kf*(pc*ac+ps*as)/(kf^2 - pc*ac*ps*as)) ;
phi = (atan(pc*ac/kf) - atan(ps*as/kf) + pi)/2;
how to find the value of be from this program
  댓글 수: 2
AndresVar
AndresVar 2022년 2월 16일
The value of be will be displayed in the Worskspace sidebar.
or use the command window, typing be shows the value of be. Or you can add disp(be) at the end of the code.
For this questions it's best to google it because it has been answered many times.
Rik
Rik 2022년 2월 16일
As @AndresVar implies: this is a fairly basic Matlab question. You may consider doing the Onramp tutorial (which is provided for free by Mathworks).
If you format your question as code, you can even run your code in the forum interface. Have a read here and here.
Since this is mostly a duplicate from you new question I'm going to close this one.

답변 (0개)

이 질문은 마감되었습니다.

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by