- Signal Logging : Logging the signal and storing the data being transferred in these signals will help us understand various activites happening in the simulation. To learn more about signal logging, please refer to the following documentation link: https://www.mathworks.com/help/simulink/gui/signallogging.html
- Try-Catch Block: Handle error using try-catch block in MATLAB and start debug mode when the execution hits the catck block of the code, this should help you enter the debugging mode in this Simulation session.
How do I recover Simulink outputs after error?
    10 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Guy Squillace
 le 27 Nov 2024
  
    
    
    
    
    Réponse apportée : Amir
 le 1 Août 2025
            I have a Simulink model that contains a bunch of ToWorkspace blocks. I call the simulation using 
SimOut = sim('MySim')
If I have a runtime error (or just press ctrl+C) and the simulation stops due to an error, is there a way to recover the data that would exist in SimOut for the portion of the simulation that did run?
For example, if I start a simulation that runs for 10min and it has an error at 9min, can I get the first 9min of the simulated data?
0 commentaires
Réponse acceptée
  Venkat Siddarth Reddy
      
 le 27 Nov 2024
        Hi Guy,
I dont think it is feasible to get the output of partial simulated results of Simulink Model. 
However, you can try to capture this data and store while the Simulation is still running by using the following approaches:
I hope these help!
Regards
Venkat Siddarth V
0 commentaires
Plus de réponses (1)
  Amir
 le 1 Août 2025
        Bit late, but you can always run via set_param('EkmcuControlledModularPlant', 'SimulationCommand', 'start');
I wanted to access logsout which, when running via out = sim(bdroot) would be in out.logsout.
If you run using the set_param, it will be simply in logsout. One thing to pay attention to is , that this is indeed equivalent (or atleast similar) to pressing Run, and in that sense, if you use this in for loop or something, it will not wait for the simulation to be finished.
0 commentaires
Voir également
Catégories
				En savoir plus sur String dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


