Can MATLAB parallel computing be used to speed up an Excel VBA loop which calculates, for each of many model points, a complex calculation formulated in an Excel worksheet?
Show older comments
An existing process uses only Excel and for each model point it takes about one second to perform a complex calculation which is specified in an Excel worksheet, and involves formulas in hundreds of Excel cells. Excel VBA is used just to sequentially loop through each of the many thousands of model points. At the end, the results of each model point are displayed in a results worksheet, as well as the combined sum of all the model point results. Can MATLAB parallel computing be used with Excel to make this process much faster? Cheers
3 Comments
dpb
on 25 Jul 2021
I dunno about parallel TB and the existing VBA code, but I'd warrant the Excel data could be imported to MATLAB, processed in MATLAB much more simply than in Excel and then written back to the target sheet in milliseconds instead.
With the MATLAB Compiler one could either package the ML code as a function called from the Excel sheet or as I've done with a similar situation, just built a standalone app that reads the Excel data, does the processing and outputs to another Excel sheet. Uses the ML runtime with a GUI interface to pick input/output files...
Tim Berry
on 25 Jul 2021
dpb
on 25 Jul 2021
Depends on just what it is, obviously. Most of the time in my experience, the multiple cells in Excel are simply it's form of array processing in that one has to duplicate the cell to hold the data or the formula to reference the data and its output that is the content of the cell.
In ML if one starts with the inputs as arrays, then those same output cells are the result of a vectorized calculation in MATLAB.
This obviously isn't always so, but I'd think worthy of thinking about in a perusal of what the spreadsheet actually does.
It could, of course, lead to a nightmare; I've also seen such that were truly incredible edifices that anybody would have thunk to have built...the functionality could have been written from a specification document, but to translate from the Excel spreadsheet implementation instead would be nightmare -- one would instead have to go at from a base design document.
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!