Matlab and Microsoft Excel
Afficher commentaires plus anciens
Hello, I was wondering if anyone could tell me how to send live data from Excel to Matlab. I have a program running in Excel that graphs live data from an Arduino Uno, now I just need to send that data into Matlab in real-time. What's the command for that? Do I need an infinite loop?
8 commentaires
Walter Roberson
le 9 Juin 2015
Merged from duplicate question:
"I have a program running that takes acceleration data from an Arduino Uno and puts it into Microsoft Excel. I downloaded Spreadsheet Link Ex for Excel so that I could send data directly into Matlab from Excel. It works great, I can send data once it has been obtained very easily, but I was wondering if there is a way to send data in real-time to Matlab from Excel using the Spreadsheet Link Ex."
Walter Roberson
le 9 Juin 2015
If you can operate Excel in somewhat real-time then you can have it call those MATLAB functions in somewhat real-time. How to operate Excel in somewhat real-time is beyond the scope of a MATLAB forum.
Michael Morotto
le 9 Juin 2015
Walter Roberson
le 9 Juin 2015
Modifié(e) : Walter Roberson
le 9 Juin 2015
Whatever you do to operate Excel in real-time, have it invoke the formula you built that gathers the data and calls out to MATLAB with it. The items built by Builder EX become calls that can appear in formula in Excel, invoked by any mechanism that can invoke an Excel formula.
Are you putting the data into Excel by using a COM object? If so then you an use the COM object to invoke the formula or cell.
Hiskiel Stephanus
le 9 Juin 2015
Hi You can try the "xlswrite" command in MATLAB and specify the excel file where the data is going to be saved. This may have to be in a loop. Thus you can dynamically allocate space in the Excel file.
I hope this solves your problem.
Michael Morotto
le 9 Juin 2015
Image Analyst
le 9 Juin 2015
Michael, you could have your MATLAB code running that will set up an ActiveX connection to the workbook. It can periodically check the workbook for new data and haul it over when new data is found. Like you keep track of the last row of data, then every 1 second (or whatever) check the row one below that and see if it's no longer empty. If there's something there, then grab all the new numbers and haul them over, and then update the last row number that is being used.
Michael Morotto
le 11 Juin 2015
Réponses (1)
Walter Roberson
le 6 Juin 2015
0 votes
Catégories
En savoir plus sur Data Import from MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!