Strange behavior

Zenker, Dr. Matthias Matthias.Zenker at erbe-med.de
Tue Nov 4 12:55:32 CET 2008


Because with the first call to myfct, you have defined a and b to be -1
and 7. Called without LHS, myfct returns the first vector element x=a+b.

Matthias

> -----Original Message-----
> From: Maki 1sy8 [mailto:debian1sy8 at gmail.com] 
> Sent: Monday, November 03, 2008 1:30 AM
> To: Scilab
> Subject: Strange behavior
> 
> Hi all.
> 
> With the following function I found in the function help 
> function [x,y]=myfct(a,b) x=a+b y=a-b endfunction
> 
> I tried
> -->c=3;d=4;
> -->[a, b]= myfct(c, d)
> b  =
> 
>   - 1.
>  a  =
> 
>     7.
> 
> Why the following ???
> 
> -->myfct
>  ans  =
> 
>     6.
> 
> 

_____________________________________________________________________
ERBE Elektromedizin GmbH
Firmensitz: 72072 Tuebingen
Geschaeftsfuehrer: Christian O. Erbe, Reiner Thede
Registergericht: Stuttgart HRB 380137




More information about the users mailing list