Make static variables in mex keep their values between calls
古いコメントを表示
I want to integrate external C code consisting of multiple functions and files using simple wrapper function
function out = callExternalCFunction(data_in)
out = coder.ceval('externalCfunction', data_in);
end
and build a MEX file.
I noticed that static variables declared in the external C code do not retain their values between MEX calls. Can I control this behaviour somehow?
1 件のコメント
James Tursa
2020 年 8 月 21 日
編集済み: James Tursa
2020 年 9 月 22 日
Can you provide simple example code? Static variables should retain their values as long as you don't clear the mex routine from memory and you don't have code that always re-initializes their values when the mex routine is called.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Write C Functions Callable from MATLAB (MEX Files) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!