[Scilab-users] interpolating varargin into calls within my function

matt bruensteiner matt_bruensteiner at yahoo.com
Thu Sep 12 00:19:33 CEST 2013


Hi,

I'm sure this has been asked before, but I'm finding it very difficult to search out the answer.

I created a function:

function plotfirst64(x, y, varargin)
    plot(x(1:64), y(1:64), varargin );

endfunction


My intention is that the varargin arguments to my function should become arguments to plot, allowing me to control the plot appearance when calling my function. Obviously, SciLab doesn't work that way and if I try to use the varargin, those arguments are ignored.

For example, I do `ploteye(x, y, "thickness", 2)` or `ploteye(x, y, "r-")` and the plot still comes out with the default line style.

Searching online I found that Matlab has a syntax that should do what I want like this:

function plotfirst64(x, y, varargin)
    plot(x(1:64), y(1:64), varargin{:} );

But that doesn't seem to work in SciLab either.

How can I pass varargin arguments through to a function called inside my function?

Thanks,

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130911/3f373cd6/attachment.htm>


More information about the users mailing list