forming table from function call

1 次查看(过去 30 天)
shiv gaur
shiv gaur 2022-2-2
评论: shiv gaur 2022-2-3
la0 = 650; k0 = 2*pi/la0; a = 100/2;
ef = 1; ec = -19.6224 - 0.443*j; % set ec = -16.6224
pc = ef/ec; tol = 1e-12;
q = (0:3)’; m=0; % set m=0,1 for even or odd modes
ga1 = 1/k0/a*atanh(-pc) - j*pi/2/a/k0*(m+2*q);
ga2 = 1/k0/a*atanh(-pc) + j*pi/2/a/k0*(m+2*q);
gin = [ga1.’; ga2.’]; gin = gin(:); % list them as -/+ pairs
q = [q’;q’]; q = q(:);
gin(1)=[]; q(1)=[]; % eliminate duplicate q=0 case
bin = sqrt(gin.^2 + ef); % initial search vector
be = pwg(la0,ef,ec,a,bin,m,tol); % solution vector for beta
ga = sqrt(be.^2 - ef); ac = sqrt(be.^2 - ec); % gamma and alpha_c vectors
E = norm(pc*ac + ga.*tanh(ga*k0*a + j*m*pi/2)) % computational error norm
num2str([be,ga,ac],’%12.6f’) % table
pl form the table from the following program
  2 个评论
Kevin Holly
Kevin Holly 2022-2-2
la0 = 650; k0 = 2*pi/la0; a = 100/2;
ef = 1; ec = -19.6224 - 0.443*j; % set ec = -16.6224
pc = ef/ec; tol = 1e-12;
q = (0:3)'; m=0; % set m=0,1 for even or odd modes
ga1 = 1/k0/a*atanh(-pc) - j*pi/2/a/k0*(m+2*q);
ga2 = 1/k0/a*atanh(-pc) + j*pi/2/a/k0*(m+2*q);
gin = [ga1.'; ga2.']; gin = gin(:); % list them as -/+ pairs
q = [q';q']; q = q(:);
gin(1)=[]; q(1)=[]; % eliminate duplicate q=0 case
bin = sqrt(gin.^2 + ef); % initial search vector
be = pwg(la0,ef,ec,a,bin,m,tol); % solution vector for beta
Unrecognized function or variable 'pwg'.
ga = sqrt(be.^2 - ef); ac = sqrt(be.^2 - ec); % gamma and alpha_c vectors
E = norm(pc*ac + ga.*tanh(ga*k0*a + j*m*pi/2)) % computational error norm
num2str([be,ga,ac],'%12.6f') % table
Do you have the function pwg?
I assume you are doing something similiar to what starts on page 17 here.
shiv gaur
shiv gaur 2022-2-3
all the argument parameter is given in program

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by