interp2 in Embedded MATLAB Function

3 ビュー (過去 30 日間)
Wen Tak Ho
Wen Tak Ho 2011 年 1 月 25 日
I am using embedded MATLAB function within Stateflow chart. I have difficulty in using the function 'interp2' within the embedded MATLAB function. Apparently, 'interp2' is not supported. Is there any workaround method for this?

回答 (2 件)

Doug Eastman
Doug Eastman 2011 年 1 月 28 日
You can still use functions that are not part of the Embedded MATLAB subset by declaring them as extrinsic. Rather than being converted to C-code this function will simply call out to MATLAB to run the function. Try adding this line to your Embedded MATLAB Function before calling interp2:
eml.extrinsic('interp2');
  1 件のコメント
Wen Tak Ho
Wen Tak Ho 2011 年 4 月 19 日
thanks for the answer, I can compile the state machine but the functionality is not there. The function returns a data type of matlab type which can not be reused in the same embedded MATLAB subset.

サインインしてコメントする。


Arnaud Miege
Arnaud Miege 2011 年 4 月 19 日
Yes, the data type returned by the function is mxArray. See this similar question for suggestions on how to deal with it.
HTH,
Arnaud

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by