1

I have a matlab function structured such that:

function[foo,bar] = MyMatlabFunction(varargin)

I call this function from VBA code thus:

Dim ML as Object
Set ML = CreateObject("Matlab.Application")
varargout = ML.Execute("MyMatlabFunction(varargin)")

This works fine, however I am only able to access the output 'foo' using this method. How do I assign another variable to get 'bar' as well? i.e. how do I write:

[varargout1, varargout2,... varargoutn] = ML.Execute("MyMatlabFunction.m")

Thank you!

Amro
  • 123,847
  • 25
  • 243
  • 454
  • why the downvote, this is a valid question. @Pooja_Parthasarathy: have you tried using [`Feval`](http://www.mathworks.com/help/matlab/ref/com.feval.html)? – Amro Jun 22 '13 at 20:18

0 Answers0