Problem reading real-time data from an excel file
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Walter Roberson
le 18 Déc 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.
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!