Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Can I use a Matlab function in a S-Function-Builder?

조회 수: 3 (최근 30일)
Andrea Molina
Andrea Molina 2014년 1월 21일
마감: MATLAB Answer Bot 2021년 8월 20일
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

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2014년 3월 27일
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.

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by