%Fermi Function Calculation, f(ΔE, T) % Constant k=8.617e-5; %Computation proper for ii=l: 4; T= l00*ii; kT=k*T; dE(ii,1)=-5*kT; for ij=1: 101; f(ii,jj)= 1/(1 +exp(dE(ii,jj)/kT)); dE(ii,jj+1)=dE(ii,jj)+(0.1 *kT) end end dE=dE(1:4,1 :101); %This step strips the extra dE value %plotting results close plot(dE,f);grid; xlabel(E-EF(eV)); text(0.05,0.2,'T= 400K'); text(-.03,0.1,'T=100K');

 采纳的回答

One problem is that this loop index should be ‘jj’, not ‘ij’:
for jj = 1 : 101
and you are using the lower-case letter ‘l’ instead of the number 1 is two places.
This runs:
k=8.617e-5;
%Computation proper
for ii= 1 : 4;
T= 100*ii;
kT=k*T;
dE(ii,1)=-5*kT;
for jj=1: 101;
f(ii,jj)= 1/(1 +exp(dE(ii,jj)/kT));
dE(ii,jj+1)=dE(ii,jj)+(0.1 *kT);
end
end
dE=dE(1:4,1 :101); %This step strips the extra dE value
plot(dE,f);grid;
xlabel('E-EF(eV)');
text(0.05,0.2,'T= 400K');
text(-.03,0.1,'T=100K');
I am not certain what result you want for the plot.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 MATLAB 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by