Accessing handle graphics from within Fortran mexfunction

1 次查看(过去 30 天)
Can you access Matlab's handle graphics from within a Fortran mexFunction? I see that there are mexSet and mexGet functions; however, they appear to apply only for C mexFunctions.
Thanks a million, Bill

采纳的回答

Titus Edelhofer
Titus Edelhofer 2011-8-15
Hi Otis,
I guess (!) the answer is yes. Handles itself are just usual doubles. Therefore you should be able to call the set and get by something like
mxArray* pprhs[3];
pprhs[0] = prhs[0]; // assuming prhs[0] is the handle
pprhs[1] = mxCreateString("tag");
pprhs[2] = mxCreateString("Bill");
mexCallMATLAB(0, plhs, 3, pprhs, "set");
Titus
  5 个评论
Jan
Jan 2011-8-15
@Titus: Please fix the prhs->pprhs confusion in your code. The line "prhs[0] = mxDuplicateArray(prhs[0])" will blow-up the memory manager...

请先登录,再进行评论。

更多回答(1 个)

James Tursa
James Tursa 2011-8-15
You can get Fortran versions of mexGet and mexSet in my Fortran 95 interface package, which can be found here:
They work the same as their C counterparts. You can also find a lot of other useful functions & utilities in this package, many of which are not available in the C API.

类别

Help CenterFile Exchange 中查找有关 Fortran with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by