automatic import into matlab after time period
2 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
Guillaume
2014 年 11 月 17 日
t = timer;
t.Period = 49 * 60;
t.TimerFcn = importfcn; %for you to define with signature: function importfcn(obj, event)
t.ExecutionMode = 'fixedRate';
Alternatively, on Windows, you could use .Net System.IO.FileSystemWatcher to raise an event whenever the file is modified
fsw = System.IO.FileSystemWatcher();
fsw.Path = 'somefolder';
fsw.Filter = 'filename.csv';
fsw.EnableRaisingEvents = true;
listenerhandle = addlistener(fsw, 'Changed', importfcn);
%signature of importfcn is function importfcn(sender, eventargs)
%add a small delay in importfcn before reading the file as the event is raised
%to make sure that file modification is complete
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!