MATLAB: Call a Matlab function

functionfunctionsmatlab function

I have developed a controller that monitors the data for 24 hours. Hence I want to run it continuously for hours.
The method I think to use is to write the code in a function and call the function through a infinite while loop.
My question: 1) How to call a function in MATLAB having no input or output arguments. The infinite while loop would simply call the function to execute it. What is the syntax??
2) Is there any better way to run programs for a indefinite period which control some hardware systems.
Thanks.

Best Answer

while 1
your_function();
end
The () is not necessary as there are no arguments, but I think they make the code easier to read.
There may be a better way, but it depends on the hardware. For example you might associate the function with a timer (see doc timer), or with a hardware interrupt.