xlsread and MATLAB engine Question

1 回表示 (過去 30 日間)
Caroline
Caroline 2013 年 7 月 12 日
Is it possible to use the xlsread function through the MATLAB engine? For example, can I read an excel spreadsheet into a cell array in MATLAB then send that cell array to C++? Would MEX files be better in this situation?

採用された回答

James Tursa
James Tursa 2013 年 7 月 12 日
You can use xlsread in a MATLAB Engine and then send it to your C++ program. Note that all data sent between the Engine and your C++ program is copied, however (doubles the memory footprint). A mex file can also use xlsread via a mexCallMATLAB call. The advantage is that the data copy can be avoided since the mex routine shares the same address space as the MATLAB program that called it.
  2 件のコメント
Caroline
Caroline 2013 年 7 月 12 日
Thank you! If I am making an executable out of the C++ file, in order to run it if it includes MEX files, is all that is needed on the machine that is running the executable the MCR? Or does MATLAB need to be installed?
James Tursa
James Tursa 2013 年 7 月 12 日
編集済み: James Tursa 2013 年 7 月 12 日
If you are deploying your MATLAB program via the MCR route and your C++ code is a mex routine, then only the MCR is needed, along with any libraries that the mex routine needs. You may need to jump through some hoops to get all the necessary mex stuff included in your deployment package. If you are using an Engine, then MATLAB has to be installed on the target machine (the Engine is just a full MATLAB program that starts in a special way to communicate with your program).

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

その他の回答 (1 件)

Caroline
Caroline 2013 年 7 月 15 日
Thank you!

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by