Beginners Guide to Excel Link?

1 回表示 (過去 30 日間)
Jeremy
Jeremy 2012 年 2 月 28 日
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!

回答 (1 件)

Jiro Doke
Jiro Doke 2012 年 2 月 28 日
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 件のコメント
Jeremy
Jeremy 2012 年 2 月 28 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Export to MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by