Octave : How to use a function of a COM interface that returns multiple values?

76 Views Asked by At

In Matlab you can use AxtiveX-objects that return multiple values.

Here's an example code:

pkg load windows
excel = actxserver('Excel.Application');
workbook = excel.Workbooks.Open('E:\Temp\del\a.xlsx');
worksheet = workbook.Worksheets.Item(1);
range = worksheet.UsedRange;
[numRows, numColumns] = size(range.Value);
workbook.Close(false);
excel.Quit();

This also works in Octave.

BUT: The interface I use looks like this:

MyComObject.BeatArray(out EventTimes, BeatTypes, TemplateNumbers: OleVariant);

and each returned parameter is a double-array. It can be used in Matlab using

[a,b,c] = foo.BeatArray

That does not work in Octave. Is there a way to use that function in Octave?

Thanks!

1

There are 1 best solutions below

5
Tasos Papastylianou On

Your question is actually 2 separate things.

  1. The "COM" interface is available via the windows package.

  2. Yes. As long as your function returns multiple outputs, then capturing multiple outputs works the same way in octave. Note that (like matlab), a single output consisting of multiple elements is not the same thing as multiple outputs.