フィルターのクリア

Avoid Copying MEX array to C Struct

2 ビュー (過去 30 日間)
Andrew
Andrew 2014 年 8 月 8 日
回答済み: Jan 2014 年 8 月 10 日
I am new to MEX. From the "phonebook.c" example, it appears that copying is required from prhs[] to a C struct . . . using either memcpy() or mxDuplicateArray().
In my case, prhs[] will be very large, (megabytes). Copying is not ideal.
Is there a way, using MEX commands, to set a pointer to a C struct to prhs[] and avoid copying??
Thanks in advance.

採用された回答

Jan
Jan 2014 年 8 月 10 日
The array duplication is only required, when an input array is modified and replied as output. In all other cases you can use the pointer to the array data inside the Mex file also without any problems.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWrite 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!

Translated by