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!