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