Simulink takes a long time to start a model with a Embedded Matlab block
    17 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Thomas Marullo
      
 el 10 de Mzo. de 2017
  
    
    
    
    
    Comentada: Carlos Ernesto Vázquez García
 el 10 de Jun. de 2025
            I have an embedded matlab block that contains a decent amount of code. When I start the Simulink model, the status bar shows that it is compiling the embedded matlab block and it takes a really long time (like 30 minutes). Is there a way to debug why it takes the compiler so long and where it would be getting hung up or any optimizations I could do?
0 comentarios
Respuesta aceptada
  Gillian Rosen
    
 el 15 de Mzo. de 2017
        
      Editada: Gillian Rosen
    
 el 15 de Mzo. de 2017
  
      Hi Thomas, 
I understand that an Embedded MATLAB block in your model is taking a long time (30 minutes) to compile every time you simulate your model, and you would like to debug this issue and find possible optimizations.
For debugging this issue, you can use the 'sldiagnostics' command to investigate which parts of the process are taking a long time. Since you are interested in debugging long compilation times, I suggest that you use this command with the 'CompileStats' option, as follows:  
>> sldiagnostics('myModel','CompileStats')
See the 'sldiagnostics' function documentation at the link below for more information:
If your Embedded MATLAB block is not changing between runs of your simulation, you could place your Embedded MATLAB block into a model reference to speed up compilation. By default, referenced models will only be re-compiled if a change is detected. Here are some documentation links to get you started with model referencing:  
3 comentarios
  Nick McDonough
 el 19 de Jun. de 2018
				I am having a similar issue. The Stateflow post-compile notify is taking forever, but I don't know how to debug further....
  Carlos Ernesto Vázquez García
 el 10 de Jun. de 2025
				Did you find a solution to this? I also have a similar issue where "stateflow post-compile notify" is taking too long to compile
Más respuestas (0)
Ver también
Categorías
				Más información sobre Simulink Coder 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!



