Beginners Guide to Excel Link?

1 visualización (últimos 30 días)
Jeremy
Jeremy el 28 de Feb. de 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!

Respuestas (1)

Jiro Doke
Jiro Doke el 28 de Feb. de 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 comentario
Jeremy
Jeremy el 28 de Feb. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Export to MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by