How do I add profiling code for reference models in my profile hook tlc ?

1 view (last 30 days)
I have been generating code to get timing data for the major subsystems using a profile hook tlc file. I send in a list of subsystem names from the code generation script and then match it to system.Name to determine if profiling code is to be generated. This doesn't work if the system I am looking for is a referenced model.
How do I get the model name inside the hook functions?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
You can get the system name using the following code. This code handles the model reference case.
%function GetSystemName(system) void
%if IsBaseSystem(system)
%assign ssName = CompiledModel.Name
%else
%assign ssName = FEVAL("regexprep",system.Name,"\<S.*\>\/","")
%endif
%return ssName
%endfunction

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!