MATLAB Answers

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

12 views (last 30 days)
Purusothaman Ganapathy
Purusothaman Ganapathy on 15 Sep 2017
Answered: Suze Zhang on 21 Sep 2017
I tried to use MATLAB Function block, but its shows code generation error in simulation.
  3 Comments
Purusothaman Ganapathy
Purusothaman Ganapathy on 19 Sep 2017
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

Sign in to comment.

Answers (1)

Suze Zhang
Suze Zhang on 21 Sep 2017
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:

Community Treasure Hunt

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

Start Hunting!

Translated by