From: Ramazan on
Hi all,

I am having difficulty to convert triple code written as C code in to Matlab .m file.

Thanks for your help in advance

double ksizero(double q,double n,double m_e) {

double kz=10000.0,ky=10000.0,kx=10000.0,kxq,kyq,kzq;
double sumback=0;
double pi=3.14;
double e=48.0*pow(10.0,-11.0);
double kB = 1.3807*pow(10.0,-16.0);
double T=300.0;
double hbar = 1.05*pow(10.0,-27.0);
double Ef=E_f(n,m_e);
double kF=pow((2*m_e*Ef),0.5)/hbar;

for(kzq=1.0;kzq<=kF;kzq+=kz)

{

for(kyq=1.0;kyq<=kF;kyq+=ky)

{

for(kxq=1.0;kxq<=kF;kxq+=kz)

{

sumback=sumback+kx*ky*kz*2*m_e/( 1+exp(((hbar*hbar*(kxq*kxq+kyq*kyq+kzq*kzq)/(2*m_e))-Ef)/kB*T))/(hbar*hbar*(q*q+q*(kxq+kyq+kzq)));

};

};



};

sumback*=e*e/(2*pi*pi*pi*q*q);


return sumback;

}
From: Rune Allnor on
On 17 Jun, 17:14, "Ramazan " <y...(a)aol.com> wrote:
> Hi all,
>
> I am having difficulty to convert triple code written as C code in to Matlab .m file.

Why?

Except for your code containing the as usual as obvious novice
blunders and flaws, it translates 1:1 to m code. Exactly what
is it you have problems with?

Rune