필터 지우기
필터 지우기

Is there a helper mex function for printing the contents of an mxArray?

조회 수: 2 (최근 30일)
Robert
Robert 2013년 6월 13일
I'm wondering if there is a helper mex function for printing the contents of an mxArray. Something similar to just typing a variable name in Matlab, e.g.:
>> A
A =
1 2 3 4
  댓글 수: 2
Kaustubha Govind
Kaustubha Govind 2013년 6월 13일
Do you mean that you would like to call the DISP command from a MEX-function?
Robert
Robert 2013년 6월 14일
Well, no, I was wondering if there was any easy way to do it in C (or using a mex function that mimics DISP), but I suppose that using mexCallMATLAB (as suggested by James Tursa below) is a pretty good solution, too.

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

답변 (1개)

James Tursa
James Tursa 2013년 6월 13일
E.g., the code for Kaustubha's suggestion:
mxArray *myvariable;
// code to fill in myvariable here
mexCallMATLAB(0,NULL,1,&myvariable,"disp");
  댓글 수: 1
Jan
Jan 2013년 6월 13일
편집: Jan 2013년 6월 19일
Of course I've voted for this: DISP is the most powerful helper function I can imagine.

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

카테고리

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