Plotting Data From Constantly Updating Textfile

3 ビュー (過去 30 日間)
Karl Haebler
Karl Haebler 2017 年 10 月 12 日
回答済み: KSSV 2017 年 10 月 12 日
I would like to plot data from a textfile which has a new entry every 10 seconds (or time period around 10 seconds), and for the plot to update as well.
To do that would I basically have to refresh the plot or rerun the program or is there a way to keep on reading a textfile whose length is always changing, and to add more data points to a plot to reflect the new data in the text file?
Thank you very much

回答 (1 件)

KSSV
KSSV 2017 年 10 月 12 日
You can get the time stamp of file if file gets modified....using:
FileInfo = dir('my text file') ;
TimeStamp = FileInfo.date;
% Get individual components of date & time in 1 Sec resolution
[Y, M, D, H, MN, S] = datevec(FileInfo.datenum);
When ever there is change in the time stamp, you read the file and plot/ update the plot. YOu can put the code in while loop.

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by