[Scilab-users] varargout doubt

Shamika Mohanan shamika.i.nair at gmail.com
Tue Nov 8 06:47:19 CET 2016


Hello,

I have a function defined as such

function varargout= callOct(fname,varargin)
    varargout=list(callOctave(fname,varargin))
endfunction

When I call this function with [c,d]=callOct("butter",8,0.1), I get the
error
!--error 21
Invalid index.

If I call the function as c=callOct("butter",8,0.1), I get no error.
varargout stores only one o/p argument even though callOctave returns two
arguments.

If I remove varargout like this

function  [b,a]=callOct(fname,varargin)
    [b,a]=callOctave(fname,varargin)
endfunction

Now when I call this function with [c,d]=callOct("butter",8,0.1), I get no
error.

I need callOct function to work with any number of output arguments and so
I need to use varargout. How do I get the function to work with varargout?

Regards,
Shamika
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161108/eb90b925/attachment.htm>


More information about the users mailing list