Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Please help with following code i am new with matlab and don't understand the error
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
clear
Eg = input('Enter your value for Eg(T) = ');
x = input('Enter your lower range for T = ');
y = input('Enter your higher range for T = ');
kb = 1.38*10^-23;
h = 6.63*10^-34;
T = x:10:y;
me = 6.19*10^-32;
mh = 5.10*10^-31;
k = (2*(((2*pi*kb*T)/(h^2))^1.5)*((me*mh)^3/4))
ni = k*exp((-Eg/2*kb*T))
plot(ni,T);
xlabel('Ni');
ylabel('Temperature');
display(ni);
Respuestas (2)
Torsten
el 30 de Oct. de 2014
Try
k = 2*(2*pi*kb*T/h^2).^1.5*(me*mh)^3/4
instead of
k = (2*(((2*pi*kb*T)/(h^2))^1.5)*((me*mh)^3/4))
Best wishes
Torsten.
0 comentarios
MA
el 30 de Oct. de 2014
clear all
clc;
Eg = input('Enter your value for Eg(T) = ');
x = input('Enter your lower range for T = ');
y = input('Enter your higher range for T = ');
kb = 1.38*10^-23;
h = 6.63*10^-34;
T = x:10:y;
me = 6.19*10^-32;
mh = 5.10*10^-31;
k=zeros(1,length(T));
ni=zeros(1,length(T));
for i=1:length(T)
k(i)=2*(((2*pi*kb*T(i))/(h^2))^1.5)*(((me*mh)^3)/4);
ni(i)=k(i)*exp(-Eg/(2*kb*T(i)));
end
plot(ni,T)
xlabel('Ni')
ylabel('Temperature')
0 comentarios
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!