Avoid Copying MEX array to C Struct
조회 수: 2 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!