What is the modification needed in the below code
์ด์ ๋๊ธ ํ์
Are the below code same? I am getting different results.
%First
scale0 = 1500;
Nai = linspace(1e13,1e19,scale0); %๐๐:1ร1013โ1ร1019๐mโ3
Ndi = linspace(1e13,1e19,scale0); %๐๐:1ร1013โ1ร1019๐mโ3
Na = ones(scale0,1)*Nai;
Nd = Ndi.'*ones(1,scale0);
y = 0;
z = 0;
%Computing Fermi Energy Level
Ef = ones(scale0,1)*0;
while y < 1500
y = y + 1;
while z < 1500
z = z + 1;
eq1 = @(Ef) ((Nc)*exp(-(Ec-Ef)/(kbT))) + ((Na(y,z))/(1 + 4*exp(-(Ef-Ea)/(kbT)))) - ((Nv)*exp(-(Ef-Ev)/(kbT)) + ((Nd(y,z))/(1 + 2*exp(-(Ed-Ef)/(kbT)))));
x1 = [0 10];
Ef(y,z) = fzero(eq1,x1);
end
end
%Second
scale0 = 1500;
Nai = linspace(1e13,1e19,scale0); %๐๐:1ร1013โ1ร1019๐mโ3
Ndi = linspace(1e13,1e19,scale0); %๐๐:1ร1013โ1ร1019๐mโ3
Na = ones(scale0,1)*Nai;
Nd = Ndi.'*ones(1,scale0);
%Computing Fermi Energy Level
Ef = ones(scale0,1)*0;
for y=1:prod(size(Nai))
for z=1:prod(size(Ndi))
eq1 = @(Ef) ((Nc)*exp(-(Ec-Ef)/(kbT))) + ((Na(y,z))/(1 + 4*exp(-(Ef-Ea)/(kbT)))) - ((Nv)*exp(-(Ef-Ev)/(kbT)) + ((Nd(y,z))/(1 + 2*exp(-(Ed-Ef)/(kbT)))));
x1 = [0 10];
Ef(y,z) = fzero(eq1,x1);
end
end
๋๊ธ ์: 1
Rena Berman
2022๋
4์ 8์ผ
(Answers Dev) Restored edit
์ฑํ๋ ๋ต๋ณ
์ถ๊ฐ ๋ต๋ณ (0๊ฐ)
์นดํ ๊ณ ๋ฆฌ
๋์๋ง ์ผํฐ ๋ฐ File Exchange์์ MATLAB์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!