フィルターのクリア

Interpreted custom function in Simulink

2 ビュー (過去 30 日間)
Vicente
Vicente 2015 年 4 月 20 日
コメント済み: Vicente 2015 年 4 月 30 日
Hello!
About the "MATLAB Function" block in Simulink, is there any way to avoid the compilation of the respective matlab file and let it be interpreted instead? Because the file is currently using some Matlab functions which prevent the block from compiling (es. try/catch, getfl, etc).
Thank you.

採用された回答

Sebastian Castro
Sebastian Castro 2015 年 4 月 20 日
編集済み: Sebastian Castro 2015 年 4 月 20 日
Yes -- you can use coder.extrinsic to declare those unsupported functions as extrinsic. Check out the "plot" example in the documentation link.
EDIT: Actually, for Try/Catch this still may not work. You can use an Interpreted MATLAB Fcn block in that case.
- Sebastian
  1 件のコメント
Vicente
Vicente 2015 年 4 月 30 日
Hi! Thank you for your answer, much appreciated, and so sorry for the late response, but here it is!
Is it possible to omit compilation for an entire class method? Even if i used 'coder.extrinsic()' for all the non compilable functions being called in such method, the problem remains as it assigns some class properties dynamically, for example:
obj.(prop_name) = prop_val; %with prop_name being a variable (string).
Symulink displays the following error: "Non-constant expression or empty matrix. This expression must be constant because its value determines the size or class of some expression. In this context, the value of the string must be known."
It would be very useful if there was a way to do this which I'm asking, as the alternative for it would be way too burdensome.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by