How can I load a preferences view (with Simulink.sdi.loadView) in simuation data inspector only with .mat file ?

2 次查看(过去 30 天)
Hi community,
I am trying to load .mat files for debug using Simulation Data Inspector, and sometimes I need to check the same signals for differents .mat files, For that I found a way that may help me, which is Simulink.sdi.loadView('savedView.mldatx'), but its dones not work as expected for me (using Matlab 2020b).
here's a steps:
1-In a folder a have a .mat file, and I put the main matlab path in that folder Path.
in Command windows put the below commands
2-Simulink.sdi.view
3-runID = Simulink.sdi.createRun('Name of mat file','file','file.mat');
after having the .mat loaded, I can setup my signals preferences and plot layout, then I save it with:
4-Simulink.sdi.saveView('saveAview') %here I save the view that I need to load each time
Now the steps to load the saved preferences.
5-Simulink.sdi.clear
6-runID = Simulink.sdi.createRun('Name of mat file','file','file.mat'); %load again my .mat file
4-Simulink.sdi.loadView('savedView.mldatx'); %load my saved preferences.
But it only loading the plot layout dimension (ie, 3x3) and not the signals within the plots.
can you please help if you have the same problem doing the same steps ?
Thanks in advance for your help

采纳的回答

Sarah Blagdon
Sarah Blagdon 2022-10-19
编辑:Sarah Blagdon 2022-10-19
I think the problem is that the name of the saved view doesn't match the name of the view you are loading. What happens if you use Simulink.sdi.loadView('saveAview.mldatx') instead? Here's a little code template similar to yours that worked for me:
Simulink.sdi.view
runID1 = Simulink.sdi.createRun('run1','file','file1.mat');
Simulink.sdi.saveView('saveAview')
Simulink.sdi.clear
runID2 = Simulink.sdi.createRun('run2','file','file2.mat');
Simulink.sdi.loadView('saveAview.mldatx');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Analyze Simulation Results 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by