[Scilab-users] function with more result variables, how?

Samuel Gougeon sgougeon at free.fr
Sun Feb 12 23:42:48 CET 2017


Le 12/02/2017 à 23:34, Erhy a écrit :
> Hello!
> I declared a function
> e.g.
> function [ DifT, FByReal, FR ] = MyXYZ(koeff)
> DifT = 33.0; FByReal = [ 1.0 , 55.7 ]; FR = [ 1 2 3; 4 5 6; 7 8 9; 10 -11
> -12 ];
> endfunction
>
> but only the first result is delivered.
>
> In help: <lhs_arguments> stands for the output argument list.
>
> How to have more result variables with different type*?*
>
> Thank you
> Erhy


I get:
--> function [ DifT, FByReal, FR ] = MyXYZ(koeff)
   >     DifT = 33.0;
   >     FByReal = [ 1.0 , 55.7 ];
   >     FR = [ 1 2 3; 4 5 6; 7 8 9; 10 -11 -12 ];
   > endfunction

--> [a,b,c] = MyXYZ(1)
  c  =
    1.    2.    3.
    4.    5.    6.
    7.    8.    9.
    10.  -11.  -12.

  b  =
    1.   55.7

  a  =
    33.

All is right.




More information about the users mailing list