forming table from function call

1 view (last 30 days)
shiv gaur
shiv gaur on 2 Feb 2022
Commented: shiv gaur on 3 Feb 2022
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 Comments
Kevin Holly
Kevin Holly on 2 Feb 2022
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 on 3 Feb 2022
all the argument parameter is given in program

Sign in to comment.

Answers (0)

Categories

Find more on Tables in Help Center and File Exchange

Tags

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!