[Scilab-users] Dump the output of a function

Samuel Gougeon sgougeon at free.fr
Thu Jan 11 13:00:45 CET 2018


Hello Christian,

AFAIK there is presently no way to skip an output parameter. The more 
handy would be
[,y2,,y4] = f(x)
but unfortunately, it does not work (yet?).
I did not find this feature as a wish on bugzilla. IMO it should be.
It is possible to use a one-character variable name, for instance among 
%, #, ! or ?.

--> [%,%,kb] = intersect(grand(1,10,"uin",0,9), grand(1,10,"uin",0,9));
--> kb
  kb  =

    7.   5.   2.

Even if the tilde was allowed, it is not very smart. A true blackhole 
would be better.

Regards
Samuel

Le 11/01/2018 à 11:31, Soulard, Christian (GE Power) a écrit :
>
> Hello,
>
> What is the Scilab way to dump the output of a function ? The Matlab 
> equivalent is tilde (~).
>
> To give an example, suppose I have an existing function f such as :
>
> function [y_1,y_2] = f(x)
>
>                 y_1 = x ^ 2;
>
>                 y_2 = x ^ 3;
>
> enfunction
>
> Suppose I want to use this function, but I am only interested in the 
> y_2 result, and I don’t want to assign a variable to the y_1 output. 
> In Matlab, I would do the following way :
>
> [~,b] = f(2)
>
> I would only get a single output variable :
>
> b = 8
>
> Thank you for your feedback.
>
>
>
> _______________________________________________
> 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/20180111/743e70e5/attachment.htm>


More information about the users mailing list