フィルターのクリア

Is there a way to have a MATLAB script run automatically as a result of some event?

2 ビュー (過去 30 日間)
I want my MATLAB script to run automatically when I import a file for it to load. Is there any way for a script to be triggered when a new file appears in the path? And if possible, how can I also get the name of the file that was just imported?

採用された回答

Titus Edelhofer
Titus Edelhofer 2015 年 6 月 9 日
Hi Nicholas,
the simplest I guess is to create a timer that
  • looks for a new file
  • starts your script, if it finds one
This way you are polling the folder. It's not really an event, but if you set the timer to 1 or 2 seconds, it's not that much difference ...
Titus
  2 件のコメント
Nicholas Sullivan
Nicholas Sullivan 2015 年 6 月 9 日
Thanks. And how do I look for a new file?
Sean de Wolski
Sean de Wolski 2015 年 6 月 9 日
Pseudo code:
newd = dir()
compare to oldd
oldd = newd

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by