C++ to Matlab Quick Help

2 次查看(过去 30 天)
Michael
Michael 2013-11-19
IF I had some C++ that looked like:
Double_t fitfun(Double_t *x, Double_t *p)
{
const Double_t sigintr2 = 12.8*12.8; // %^2
const Double_t sigelec2 = p[0]*p[0];
const Double_t G = diethorn(x[0])/diethorn(2100.);
const Double_t out = TMath::Sqrt(p[1]*p[1]+sigintr2+sigelec2/G/G);
return out;
}
What would be the significance/translation of this? I feel liek it does a fit.. I have a function which calculates that diethorn (parameter) for use in that third line which looks like:
function G = diethornPar(V)
delV = 26.7; % volts
E_min =38.3e3; % volts(/m?)
a = 25.0e-4; % cm
lam_2pi = (V*0.735-73)/2/pi;
lnG = log(2)*lam_2pi/delV*log(lam_2pi/a/E_min);
G = exp(lnG);
end;
If this is too detailed that's ok.
Thanks for your time, Michael

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call C++ from MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by