필터 지우기
필터 지우기

How to pass and access an structure array in mex

조회 수: 2 (최근 30일)
mohsan niaz
mohsan niaz 2014년 4월 20일
댓글: James Tursa 2014년 4월 21일
Hi everybody,
I am trying to pass a structure array to mex function through Matlab. I have read a lot on internet but i cannot find a simple example in form of code that can explain it. Kindly can some one explain me via a simple code. For example i am trying to pass the following structure array to a mex function.
tt = 1; for i = 1:r for j = 1:c edge(tt).row = i; edge(tt).col = j; tt = tt + 1; end end end
  댓글 수: 1
James Tursa
James Tursa 2014년 4월 21일
Are you simply trying to recover the i and j values inside the mex function? Or is there a larger context or different problem you are actually trying to solve? mxGetField followed up with mxGetScalar can do the job you have requested.

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

답변 (1개)

dpb
dpb 2014년 4월 20일

카테고리

Help CenterFile 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!

Translated by