Constructor MexFunction with parameters

Hi guys,
I am using MATLAB with C++ mex code for research. I know we can override constructor and deconstructor in MexFunction (see here). However, I want to initilize the MexFunction() object with parameters, e.g.:
MexFunction(int initial_seed) {
gen.seed(initial_seed);
std::cout << "MexFunction: Initializaing RNG produced:" << gen() << std::endl;
}
Is it possible to implement such function? If not, any work around?
Thanks!

답변 (0개)

카테고리

도움말 센터File Exchange에서 Call C++ from MATLAB에 대해 자세히 알아보기

질문:

2019년 9월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by