How can i pass a matlab struct variable into a C MEX S function as an input argument?
5 ビュー (過去 30 日間)
古いコメントを表示
as titled, if it is possible? many thanks.
0 件のコメント
回答 (1 件)
Aditya Singh
2023 年 7 月 5 日
編集済み: Aditya Singh
2023 年 7 月 5 日
Hi,
To my understanding you need to pass MATLAB struct to MEX function.
You can do it by calling the C function with a MATLAB StructArray.
st.Name = 'Color';
st.Value = uint8([1 0 1]);
result = myMexFcn(st);
Assign input of MATLAB type struct in the MEX function.
matlab::data::StructArray inStructArray = inputs[0];
and return output to be of type struct in MATLAB.
For more information you can refer to:
Hope it helps
2 件のコメント
Aditya Singh
2023 年 7 月 5 日
You can refer to How to pass a structure parameter in simulink mask to C mex S-Function? - MATLAB Answers - MATLAB Central (mathworks.com) and see if it helps.
参考
カテゴリ
Help Center および File Exchange で Naming Conventions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!