Is it possible to use a function that has multiple output variables in Excel Builder?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 27 de Jun. de 2009
Editada: MathWorks Support Team
el 18 de Nov. de 2016
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.
Respuesta aceptada
MathWorks Support Team
el 18 de Nov. de 2016
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Export to MATLAB en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!