MATLAB Answers

Accessing handle graphics from within Fortran mexfunction

조회 수: 1(최근 30일)
Otis 15 Aug 2011
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 15 Aug 2011
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");
  댓글 수: 5
Titus Edelhofer
Titus Edelhofer 15 Aug 2011
Hi Jan,
thanks for the reminder, done ...

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

추가 답변(1개)

James Tursa
James Tursa 15 Aug 2011
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.
  댓글 수: 1
Otis 15 Aug 2011
@James ... Cool!! I will definitely check it out. Thanks!!

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

Community Treasure Hunt

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

Start Hunting!

Translated by