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

Eric Dubois grocer.toolbox at gmail.com
Thu Sep 12 08:11:48 CEST 2013


Hello.

plot(x(1:64),y(1:64),varargin(:))

should work.

Éric
Le 12 sept. 2013 00:20, "matt bruensteiner" <matt_bruensteiner at yahoo.com> a
écrit :

> 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
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130912/6d5ee907/attachment.htm>


More information about the users mailing list