Problem reading real-time data from an excel file
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I'm having trouble reading from an Excel file. I'd trying to read real-time data about every second.
But, it reads something, but the data are not updated. In other words, it reads the same value over & over -- no updating is done. I'm using Windows 7 with this command ...
r = xlsread('C:\Users\DN\Desktop\qx.xlsx', 1, 'C5:O5')
When I do ...
[fid, status] = fopen('C:\Users\DN\Desktop\qx.xlsx','rt')
it gives me
fid = 3 & status = '' does this mean anything?
Any help will be greatly appreciated,
Thanks
Damo Nair
0 Commenti
Risposte (1)
Walter Roberson
il 18 Dic 2017
You appear to be using MS Windows. I suspect you have Excel installed. xlsread() uses ActiveX connections to Excel to read data in the case of MS Windows with Excel installed. If you are using one of the last few releases, then xlsread caches connections to reduce overload instead of opening and closing the same file each time. That is probably causing problems for you.
In cases where you are reading the same file over and over again, you are probably better off using ActiveX directly. You can even create callbacks to get notified when the data changes.
In the meantime, try adding the option 'basic' to your xlsread() command; that will force it to read the file as a text file instead of using ActiveX to ask Excel for the data.
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!