How to write a Matlab code that shall be executed only once - Embedded MATLAB Function
Mostrar comentarios más antiguos
Hello,
I am writing a code inside my simulink model using Embedded MATLAB Function. Here I have a small part of code which I want to execute only once in runtime at startup. But I do not know how to do it? Please help me. The flag set technique is not helping me as i get error.
Following piece of my variable init I would like to execute only once. Could you please suggest me some methods to make it so.
Counter = 0;
RotateDir = 0;
Reset = 1;
InitRunOver = 0;
Thanks.
1 comentario
Azzi Abdelmalek
el 9 de Nov. de 2012
Editada: Azzi Abdelmalek
el 9 de Nov. de 2012
can writte the full function: function .... (input & output of your function)
Respuestas (2)
Azzi Abdelmalek
el 9 de Nov. de 2012
0 votos
If you need just to make initialization, you can use
- model properties
- callbacks
- init fcn: then writte in your code
Ganesha
el 10 de Nov. de 2012
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!