use Extrinsic function in Embedded Matlab Function of Simulink

10 ビュー (過去 30 日間)
Tong-Seop
Tong-Seop 2011 年 7 月 5 日
I create function of TriScatteredInterp 'name of AFUNCTION' in MATLAB.
But my program is basically based on simulink. so, I wanna call this TriScatteredInterp function by embedded MATLAB Function icon. Thus, I make
=======================
function y = fcn(u1,u2)
%#eml
eml.extrinsic('AFUNCTION');
y = feval('AFUNCTION',u1,u2);
=============================
But there is an error message. 'Function output 'y' cannot be of MATLAB type' I've learned about this output type so if output type is a double, I can correct this problem by adding y=0; (y is scalar of type double)
then what can I correct the problem about the value of TriScatteredInterp?
y = feval('AFUNCTION',u1,u2) has an output A type of TriScatteredInterp

採用された回答

Kaustubha Govind
Kaustubha Govind 2011 年 7 月 5 日
The Embedded MATLAB Function block only allows inputs/outputs of numeric types - TriScatteredInterp is not a supported type.
Could you explain why you would like to output an object of type TriScatteredInterp? Note that you cannot output such a signal to Simulink because only numeric signals are allowed. Perhaps you should modify your design such that you output only numeric values.
  1 件のコメント
Tong-Seop
Tong-Seop 2011 年 7 月 5 日
Thank you for your answer.
I didn't realize about allowable signal in simulink.
I think I have to modify my design.
Thanks again.

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by