Is it possible to use a function that has multiple output variables in Excel Builder?
2 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2009 年 6 月 27 日
編集済み: MathWorks Support Team
2016 年 11 月 18 日
I am trying to call an Excel Builder function that has more than one output variable using the wrapper function that is generated by Excel Builder, but I get an error stating that I cannot assign output to an array.
採用された回答
MathWorks Support Team
2016 年 11 月 18 日
The following paragraph is taken from the Excel Builder documentation:
VBA provides two basic procedure types, functions and subroutines. You access a VBA function directly from a cell in a worksheet as a formula function and access a subroutine as a general macro. Function procedures are useful when the original MATLAB function takes one or more inputs and returns one scalar output. When the original MATLAB function returns an array of values or multiple outputs, you need a subroutine procedure to map these outputs into multiple cells/ranges in the worksheet. When a MATLAB Excel Builder component is created, a VBA module (.bas file) is produced. This file contains simple call wrappers each implemented as a function procedure for each method of the class.
Therefore, you will be unable to use the simple Function wrapper that was generated by Excel Builder. Instead, you will have to write your own wrapper to handle the multiple outputs. There are examples in the Excel Builder documentation that show how to do this. You can find examples at the following URL:
<http://www.mathworks.com/help/releases/R2014b/matlabxl/ug/coding-your-microsoft-visual-basic-application.html>
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Export to MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!