[Scilab-users] Scilab function with variable input and output arguments

Rafael Guerra jrafaelbguerra at hotmail.com
Mon Sep 10 04:44:47 CEST 2012


Hello all,

I have a Scilab function defined with variable input and output arguments:
    function [varargout] = myfunction(dz,varargin);
    ...
this function receives as input N matrices and outputs other N matrices (N
is variable).

I managed to handle the variable inputs by defining a list (of matrices):
   backuplist = list();
and by putting in this backuplist the N matrices to be processed by
myfynction:
[matrix1 matrix2 .. matrixN] = myfunction(dz,backuplist(1:N));

The coding problem lies with the left-hand side of the function call above:
one needs to specify all the output variables but their number is variable
during the execution of the program.

It seems that in Scilab we cannot use the same trick as for the input, i.e.,
to define a list of N matrices:
    matrixlist = list();
and call myfunction as:
    matrixlist(1:N)= myfunction(dz,backuplist(1:N));

How can this general Scilab programming problem be handled?

Thanks in advance for your advice,
Rafael



--
View this message in context: http://mailinglists.scilab.org/Scilab-function-with-variable-input-and-output-arguments-tp4024796.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list