What Takes to Wrap MATLAB function to Use From Excel?
10 views (last 30 days)
Show older comments
I've got a MATLAB function that pulls data from an Excel spreadsheet (actually two separate ones) and then writes after processing into a third.
It does not return any values to the spreadsheets containing the data it uses and writes it in a "veritable plethora" of places scattered all around in the target.
What I'd like is for the person who is working in the one spreadsheet containing the source of most of the data to be able to call the MATLAB function to update the other without needing to run MATLAB itself--they don't have the skillset nor the license so I need to be able to wrap the needed runtime.
7 Comments
Mario Malic
on 20 Mar 2021
Walter Roberson
on 20 Mar 2021
MATLAB Compiler SDK is the appropriate toolbox for building something that can be called from Excel. Requires MATLAB Compiler license as well. I have never tried it (I do not have a Windows license for Excel)
Accepted Answer
Image Analyst
on 20 Mar 2021
Spreadsheet Link™ connects Excel® spreadsheet software with the MATLAB® workspace, enabling you to access the MATLAB environment from an Excel spreadsheet. With Spreadsheet Link software, you can exchange data between MATLAB and Excel, taking advantage of the familiar Excel interface while accessing the computational speed and visualization capabilities of MATLAB.
If they don't have MATLAB then you can either write your program in VBA in Excel and launch executables created by the MATLAB compiler, OR you can have the compiled standalone MATLAB app control Excel though ActiveX.
13 Comments
Image Analyst
on 22 Mar 2021
Persistents and globals do not remain somewhere in computer memory once the app exits, so they're not retained from session to session. That's why you need to store them in a small .mat file. It shouldn't be a big deal. I do it all the time, and even have other files, like splash screen images, sample data files, etc. that I ship along with my executable.
More Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!