On 11.01.2016 09:26, Dang Ngoc Chan, Christophe wrote:
function [n, varargout] = foo()
varargout = list(1, 2, 3, 4);
n = argn(1);
endfunction
[N, L] = foo()
Disp(L)
It looks like in this case output arguments are not variable but limited
to 2 (one single element and one list), so varargout works like any
other variable. In Scilab 6.0 it would make sense to swap the output
arguments:
function [varargout, n] = foo()
varargout = list(1, 2, 3, 4);
n = argn(1);
endfunction
as this would allow using the elements directly in an expression like this:
LL=foo()(3)^foo()(2)
Or just put everything in the list and forget about varargout:
function [al] = fal(varargin)
al = list( 1, 2, 3, 4, [argn(1),argn(2)]);
endfunction
inarguments=fal(7,8,9)($)(2)
JÅ
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users