Hi, I am trying access the matlab variables from C. I am using the MATLAB engine to start matlab from C. When I read back the variable from matlab to c, it's in mxArray format. But how to read the data from this mxArray? Is there is any simple example file that I can refer to understand the concept. I check the explore.c from example/extern/mex/ but it's so confusing.
Regards Subin

댓글 수: 1

Samuel Gray
Samuel Gray 2022년 2월 16일
try to be more specific with your question..."it's so confusing" is, unfortunately, quite vague...

댓글을 달려면 로그인하십시오.

 채택된 답변

Jan
Jan 2011년 12월 1일
편집: James Tursa 2022년 2월 16일

0 개 추천

mxGetPr replies the pointer to the data of a DOUBLE array. For the other elementary types use e.g.:
int8_T *p;
p = (int8_T*) mxGetData(Data);
With Data is the mxArray pointer.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

태그

질문:

2011년 12월 1일

편집:

2022년 2월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by