STREAMING REAL TIME DATA FROM EXCEL TO MATLAB

14 views (last 30 days)
Ciro
Ciro on 14 Feb 2020
Commented: Abbas HAMADE on 18 Mar 2021
Dear all,
I have an excell spreadsheet feeded in real time trought a DDE from a trading platform, my aim is to stream the real time data from excel to Matlab. Matlab DDE functions are not available in my version which is R2018a, so I can't stream the data directly in Matlab without pass through excel.
The data in excel is available in a table in which the value of all cells vary over time without a defined frequency; my aim is to acquire in Matlab the value "as it comes" from market. The acquisition of the data each "x seconds" (at a fixed sample frequency) is useless for my scope.
Attached there is a zip file which containes a short screen recorded video of 10 seconds which shows the excel table which I want to aquire; the video shows the dynamics with which the value in cell vary.
Is there a way to do what I intend to do?

Answers (1)

Jacob Wood
Jacob Wood on 14 Feb 2020
Edited: Jacob Wood on 14 Feb 2020
One possibility - you can constantly read the Excel document with xlsread(); this will read in new values every time the Excel document is saved.
while 1
d = xlsread('test.xls');
disp(d)
end
Additionally, and likely a faster solution, would involve having Excel stream the data to a socket which Matlab is listening to.
  2 Comments
Ciro
Ciro on 17 Feb 2020
Dear Jacob,
thanks for your prompt reply; the table generated with xlsread is static and does not update in real time. Moreover the loop you have suggested keep the Matlab busy indefinitely showing (disp(d)) always the same values aquired in the beginning. In addition I get 'NaN' values for all the cells whose values are dinamically updated in the excel.
For the second solution you have proposed, which foresees the excel to stream the data in a socket, I'm still evaluating it; It could be a solution. I'll keep you updated.
Thanks!
Ciro

Sign in to comment.

Categories

Find more on Data Import from MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!