Executing Stopfcn model callback
    14 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Karl Neuhold
 el 21 de Ag. de 2017
  
    
    
    
    
    Respondida: Aniruddha Katre
    
 el 22 de Ag. de 2017
            Hello!
When is the stopfcn callback (model callback) executed? I start the model: sim (...); exit force;
I can not find information in the documentation.
thanks Karl
0 comentarios
Respuesta aceptada
  Aniruddha Katre
    
 el 22 de Ag. de 2017
        See the section called Model Simulation Callback Parameters.
The StopFcn callback will execute when a simulation stops by either running to completion or is stopped by the user.
When you use exit, that is simply going to close MATLAB entirely and the execution of the StopFcn callback is a moot point.
Try a simple test:
In a models StopFcn callback define a variable such as x = 10. Then run the simulation using sim or just pressing the simulate button. When the simulation runs to completion, the variable x should be defined in the workspace.
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Model, Block, and Port Callbacks en Help Center y File Exchange.
			
	Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

