PasteSite.Com

Recent Pastes

Sign Up!

PasteSite is open to the public, but with limited features. Register to be able to modify access rights, track your pastes and more...

Change the theme

If you prefer reading light text on a dark background to dark text on a light background, then you might want to try the dark theme.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
A = zeros(nummesh,nummesh);
m=1;%mesh number
n=1;
LN=1;%layernumber counter
pos=0;
while pos<=LENGTH(end)%pos is postion tracker for system can't be for loop as pos is only exsist in for loop not as var.
    if LN<=numlay&&pos==LENGTH(LN+1)&&pos~=LENGTH(end)
        LN=LN+1;%change of barrier
    end
        A(m,n)=(4/(acc*1e6)) -(2*(k0*k0)*(layer(LN).Refract)*(layer(LN).Refract));
        if m>1 && m<nummesh && n<nummesh
            A(m,n+1)=-2/(acc*1e6);
            A(m,n-1)=-2/(acc*1e6);
        elseif m==1
            A(m,n+1)=-2/(acc*1e6);
        elseif m==nummesh||m>nummesh||n==nummesh
            A(m,n-1)=-2/(acc*1e6);
        end    
    m=m+1;
    n=n+1;
    pos=pos+acc;
end

Reply to This Paste

(leave blank to make this paste permanent)
(if set as private)