Timers and procedures which are called when a certain events occur in Matlab
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi! I would like to build a program which calls a function either every 30 seconds or when either of 2 matrices have a change in value. Is there a way to code this in Matlab without using GUI?
Thanks in advance!
Answers (2)
Daniel Shub
on 9 Apr 2012
Yes (more or less). The every 30 seconds part can be done with a timer. There might be some jitter (it might be 30.1 seconds or 29.9 seconds or even over 60 seconds), but assuming your computer is not working too hard on other things, the jitter should generally be small. To find out about timers
doc timer
To observer the matrices you should use MATLABs OOP system. I think you will need to use a handle class and want to create a listener for the set properties of your two matrices.
per isakson
on 9 Apr 2012
0 votes
This is two questions. The answer two both is YES. You will find better answers in the documentation. To start search for
- "Program Scheduling"
- "Listening for Changes to Property Values"
There is no need to use a GUI.
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!