Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The procedure for utilizing a COM interface function that gives back several values in Octave is as follows:

  1. First, you need to create a COM object using the actxserver function. For example, if you want to create an object for Microsoft Excel, you can use the following command:
excel = actxserver('Excel.Application');
  1. Next, you need to call the COM interface function that returns several values. For example, if you want to get the values of the cells A1 to C3 of the active worksheet, you can use the following command:
[values, status] = excel.Range('A1:C3').Value;

In this case, the function Range returns an object that represents the cells A1 to C3, and the Value property of that object returns a matrix of values. The [values, status] syntax allows you to capture both the matrix of values and any error status that the function might return.

  1. Finally, you can use the disp function to display the values on the screen, or you can manipulate the values further using Octave's matrix functions. For example:
disp(values);
mean_values = mean(values, 'all');
disp(mean_values);

This code would display the matrix of values on the screen, and then calculate the mean of all the values and display it on the screen.