Programmatically save Simulnik profile data

조회 수: 5 (최근 30일)
Abhijit
Abhijit 2013년 11월 13일
답변: jiang 2023년 9월 20일
How do I save Simulink Profile data programmatically from a .m script?
  댓글 수: 2
Danilo NASCIMENTO
Danilo NASCIMENTO 2013년 11월 14일
You mean the workspace?
Abhijit
Abhijit 2013년 11월 14일
If I do the following, this will open up a HTML file. My question is how could I save the HTML file programmatically (NOT manually). This is because I am runnign the following command inside a loop
set_param(gcs,'simulationmode','normal','Profile','on');
sim(bdroot)

댓글을 달려면 로그인하십시오.

답변 (3개)

The Matlab Spot
The Matlab Spot 2013년 11월 14일
If you are mentioning about Simulink model profiling options, check out
Simulink.SoftwareTarget.profile
in simulink documentation
  댓글 수: 2
Abhijit
Abhijit 2013년 11월 14일
Thanks. I think that would work for 2013b. What about 2012b?
The Matlab Spot
The Matlab Spot 2013년 11월 15일
This i found in the 2011a documentation... might be of help...This is refering to a model from the simulink demo files...
How to Save Simulink Profiler Results
You can save the Profiler report to a variable in the MATLAB workspace, and subsequently, to a mat file. At a later time, you can regenerate and review the report.
To save the Profiler report for a model vdp to the variable profile1 and to the data file report1.mat, complete the following steps:
In the Simulink Profiler Report window, click click here. Simulink saves the report data to the variable vdpProfileData.
Navigate to the MATLAB command window.
To review the report, at the command line enter: slprofreport(vdpProfileData)
To save the data to a variable named profile1 in the base workspace, enter: profile1 = vdpProfileData;
To save the data to a mat file named report1, enter: save report1 profile1
To view the report at a later time, from the MATLAB command window, enter: % Load the mat file and recreate the profile1 object load report1 % Recreate the html report from the object slprofreport(profile1);

댓글을 달려면 로그인하십시오.


Henri Jouty
Henri Jouty 2017년 5월 10일
Hi,
I have a similar problem but my Simulink model is heavy. Recreating the .html file from the .mat file take a lot of time. Is there any way I can save the .html file instead of the .mat file?
Thanks

jiang
jiang 2023년 9월 20일
I noticed that in newer version R2020a, the Profiler data can be access by the simulation out like below:
out = sim(bdroot, 'Profile', 'on');
'model' parameter must be a character vector
pdata = out.SimulationMetadata.TimingInfo.ProfilerData;
It can be found at https://www.mathworks.com/help/simulink/slref/simulinkprofiler.html.

카테고리

Help CenterFile Exchange에서 Manual Performance Optimization에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by