How can I use et_param in MATLAB function block?

2 ビュー (過去 30 日間)
Amira chriki
Amira chriki 2018 年 2 月 27 日
回答済み: BHARANISHRAJ D S 2020 年 12 月 2 日
Hi, I am trying to call a m file from Simulink. I have to use set_param in my code in MATLAB function block, but I am getting this error: Function 'set_param' is not supported for code generation. Consider adding coder.extrinsic('set_param') at the top of the function to bypass code generation.
any idea?

回答 (1 件)

BHARANISHRAJ D S
BHARANISHRAJ D S 2020 年 12 月 2 日
Hi there,
Use
coder.extrinsic('set_param')
before declaring set_param in function.
Example
function fcn(path_c, parameter_c, value_c, path_h, parameter_h, value_h)
coder.extrinsic("set_param")
set_param(path_h, parameter_h, value_h);
set_param(path_c, parameter_c, value_c);
coder.extrinsic('fcn')
end
Thanks.

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by