Call a Matlab function
2 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
採用された回答
David Young
2012 年 3 月 28 日
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.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!