help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plotting live / real-time data from a csv / txt file


From: Przemek Klosowski
Subject: Re: Plotting live / real-time data from a csv / txt file
Date: Fri, 5 Apr 2019 14:31:11 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

Am 05.04.19 um 05:23 schrieb RT:
I have thermocouple that creates a CSV file in the format "Date,Time, Temperature" is it possible to have Octave read the csv file in real-time and plot the data in real-time?  I'm running Octave 5.1 Ubuntu 64bit.
I don't think you mean 'realtime' with microsecond accuracy---I am guessing that your CSV file is being written incrementally with some reasonable timing interval, similarly to

while sleep 1; do echo $x,$y>>data; let x=x+1; let y=x%5; done &

In that case, you can simply write Octave code like this:

while 1;  pause(1); csvread('data'); plot(ans(:,1),ans(:,2)); end

This is horrible code---rereads the entire file every second and all, but it probably works to show your data.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]