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
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Analyze Simulation Results 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!