MATLAB: How to programatically save Simulink Profiler data to workspace

simulink

How to programatically save Simulink Profiler data to workspace. I get an error regarding invalid address when select the option "To write this data as ProfileData in the base workspace click here"

Best Answer

As a workaround please use the following command to save the ProfileData in the base workspace:
>> sl('getProfileData','<filePath>','<modelName>')
Replace <filePath> with the path to the data file with the profile information. You can find this path by hovering over the Click Here option in Simulink Profile Report.
Replace <modelName> with any string that you would like to use as the variable name for the ProfilerData variable stored in workspace.