How can I run Specific M-Script in each timestep of SIMULINK Model Simulation.

1 回表示 (過去 30 日間)
Purusothaman Ganapathy
Purusothaman Ganapathy 2017 年 9 月 15 日
回答済み: Suze Zhang 2017 年 9 月 21 日
I tried to use MATLAB Function block, but its shows code generation error in simulation.
  3 件のコメント
Purusothaman Ganapathy
Purusothaman Ganapathy 2017 年 9 月 19 日
Errors occurred during parsing of MATLAB function 'Param_Set1/MATLAB Function'(#3239)
Code Directory : "D:\NS\Project\SIL_MIL\MIL_SIL_Ver2.5\Testing\BCM_HFM_Comminication_mfcn\05_Model_for_SIL_Test\slprj\_sfprj\swcC1aBcmHfmComm_swc_SIL_TestingModel\_self\sfun\src"
Machine (#3237): "swcC1aBcmHfmComm_swc_SIL_TestingModel" Target : "sfun"
Chart "MATLAB Function" (#3239):
. Code generation failed Errors occurred during parsing of MATLAB function 'Param_Set1/MATLAB Function'(#3239)
Purusothaman Ganapathy
Purusothaman Ganapathy 2017 年 9 月 19 日
The Script inside the MATLAB Function is:
function fcn(Input_Val,flag,Count)
if isequal(flag,1)
ConstantName = evalin('base',params{Count,1});
ConstantName.Value =Input_Val;
end

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

回答 (1 件)

Suze Zhang
Suze Zhang 2017 年 9 月 21 日
Hi Purusothaman,
It seems that function "evalin" is not supported for code generation in MATLAB Function block. Please refer to the link below for a list of functions and objects that are supported for C/C++ code generation:

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by