Can I use a Matlab function in a S-Function-Builder?
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
I have this function with the input T0 and output J. I would like to use the Matlab function "dips" like this:
mexCallMATLAB(0, NULL, 1, T0, "disp");
I don't have any compiling errors, however everytime I run the function Matlab crashes. What did I do wrong? I tried to cast it like this:
mexCallMATLAB(0, NULL, 1, (mxArray *)T0, "disp");
but it did not work.
Thanks for your help. Andrea
Réponses (1)
Kaustubha Govind
le 27 Mar 2014
0 votes
I'm assuming T0 here is either an input/output signal or parameter? These are usually pointers of a built-in C type (like real_T*), so you cannot force a cast to mxArray*. You need to construct the mxArray using one of mxArray creation functions.
Cette question est clôturée.
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!