Beginners Guide to Excel Link?

1 Ansicht (letzte 30 Tage)
Jeremy
Jeremy am 28 Feb. 2012
Looking for a good source to get started using Excellink. I currently have a "simulation" that runs in Excel VBA (at the time it was the only numerical solver I had access to). Part of the simulation requires running a binary integer programming problem. Excel Solver can take literally hours to do this for large data sets. Rather than reqriting the whole thing, I'd like to simply modify my existing code to call bintprog() and get the resulting vector back. I've never used Excel Link and was wondering if anyone could recommend a good beginner's guide, preferably with some examples similar my situation...i.e. having the VBA call a Matlab function and get the result back for further VBA processing. Thanks!

Antworten (1)

Jiro Doke
Jiro Doke am 28 Feb. 2012
Have you gone through the documentation for Excel Link (or Spreadsheet Link EX)? It has several examples, including writing VBA code to call MATLAB.
  1 Kommentar
Jeremy
Jeremy am 28 Feb. 2012
I found a couple of examples in the documentation of fairly basic operations. What I gather is that you mainly use
MLEvalString("<whatever you would type in MATLAB>")
So in my case, MLEvalString("x=bintprog(f,A,b)") assuming I had used MLPutVar to populate f, A, and B. It's not made explicitly clear, but I assume the VBA execution pauses until the MatLab execution completes? For large sizes, bintprog can still take 15-20 seconds to execute.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Export to MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by