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

2 次查看(过去 30 天)
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 个评论
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");

类别

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