How do I generate Simulink Profiler Report with execution times of subsystems in my model?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 7 Mai 2020
Beantwortet: MathWorks Support Team
am 27 Mai 2020
My Simulink model interfaces with real-time hardware and performs three tasks:
1) Read sensor data from an external device.
2) Perform calculations.
3) Write control commands to the external device.
The blocks involved in each of these tasks are encapsulated in separate subsystem blocks. I want to know how much time is spent within each subsystem block during a simulation run.
How do I create a Simulink Profiler report with execution times reported in this format?
Akzeptierte Antwort
MathWorks Support Team
am 7 Mai 2020
To set Simulink Profiler to generate a report with the rows in the table showing the processing time taken by each task's subsystem block, follow these steps:
For the subsystem block corresponding to each of the tasks in the model,
1. Right-click on the subsystem block and click on "Block Parameters (Subsystem)" near the bottom of the menu.
2. In the "Main" tab, enable the "Treat as atomic unit" option.
3. In the "Code Generation" tab, in the drop-down menu for "Function Packaging:", select the "Reusable function" option.
4. Click the "OK" button.
In the Simulink model, navigate to the following setting:
Configuration Parameters > "Verification" tab > Measure function execution times
Set to "Coarse (referenced models and subsystems only)"
Click on the OK button.
Now follow one of the procedures to run the model with the profiler on, such as:
>> modelName = 'simulink_model_filename_noExt';
>> load_system(modelName)
>> set_param(modelName,'Profile','on')
>> sim(modelName);
The above solution was verified in MATLAB R2019b.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Subsystems finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!