필터 지우기
필터 지우기

Can Excel Add-in created by Matlab compiler return multiple outputs?

조회 수: 1 (최근 30일)
Ji Li
Ji Li 2018년 9월 17일
답변: Ran Chen 2018년 9월 20일
I have defined a Matlab function which returns several tables as outputs. The function works well in Matlab, if I compiled the code into Excel add-in, when I call the function in Excel, can I also get multiple tables? How do I define the cell range each table is placed? If I cannot get multiple outputs, how can I combine the tables into a single one while the tables are of different sizes and variable names?

채택된 답변

Ran Chen
Ran Chen 2018년 9월 20일
Hi,
You can use the Function Wizard to assist in returning function output to multiple cells, or ranges of cells, in a worksheet. You can define the cell range each table or matrix is placed on the 'Output' tag.
Key tasks in using the Function Wizard to achieve this goal are:
1) Install the Function Wizard.
2) Start the Function Wizard.
3) Select the option to incorporate your built COM component into Microsoft Excel.
4) Define the new MATLAB function you want to prototype by adding it to the Function Wizard and establishing input and output ranges.
5) Test your MATLAB function by executing it with the Function Wizard.
6) Create a macro.
7) Execute the macro you created using the Function Wizard.
8) Optionally inspect or modify the Microsoft® Visual Basic® code you generated with the COM component. Optionally, attach the macro you created to a GUI button.
Detailed instructions for each of these key tasks are available in the MATLAB Compiler documentation:
https://www.mathworks.com/help/compiler/excel/executing-functions-and-creating-macros-using-the-function-wizard.html

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by