Running Matlab script from Excel

I have a Matlab m-file that I would like to execute from Excel. How do I write the Excel VBA code to do so?
I have Spreadsheet Link EX installed and I am able to import and export values between Excel and Matlab, but I can't seem to find an easy way to run my custom m file.

 采纳的回答

Chirag Gupta
Chirag Gupta 2011-7-5
With the spreadsheet Link EX installed, you should be call your custom MATLAB code using the Add-in.
Click on MATLAB Add-in -> Run custom code -> Enter your function name
For doing so in VBA, refer to

1 个评论

Thanks. Tried this earlier, but it didn't seem to work. Works now after I fiddled around with the file paths where my script was located.

请先登录,再进行评论。

更多回答(1 个)

2 个评论

This will not utilize the already running Spreadsheet link
Thanks for the suggestion.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 MATLAB Functions in Microsoft Excel 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by