Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Robert
Robert am 13 Jun. 2013
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 Kommentare
Kaustubha Govind
Kaustubha Govind am 13 Jun. 2013
Do you mean that you would like to call the DISP command from a MEX-function?
Robert
Robert am 14 Jun. 2013
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

James Tursa
James Tursa am 13 Jun. 2013
E.g., the code for Kaustubha's suggestion:
mxArray *myvariable;
// code to fill in myvariable here
mexCallMATLAB(0,NULL,1,&myvariable,"disp");
  1 Kommentar
Jan
Jan am 13 Jun. 2013
Bearbeitet: Jan am 19 Jun. 2013
Of course I've voted for this: DISP is the most powerful helper function I can imagine.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Write C Functions Callable from MATLAB (MEX Files) finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by