[Scilab-users] Puzzling behaviour ignoring 'Invalid index' error

AntonSeab antseabra at gmail.com
Fri Jan 18 05:11:40 CET 2013


Hi,

I'm finding the following behaviour puzzling. When running the following
code that has one typing error 'lambda(t-t_z)' instead of 'lambda*(t-t_z)':

lambda = -0.9;
function exch=e(t,t_z)
        exch = exp(lambda(t-t_z));
endfunction
e(4.999,3)

we get unexpectedly:

-->e(4.999,3)
 ans  =
 
    0.4065697  

This problem happens for other values t < 5. But for e(5.000,3), or other
values t > 5, we get as expected an error message:

-->e(5.000,3)

 !--error 21 
Invalid index.
at line       2 of function e called by :  
e(5.000,3)
at line       7 of exec file called by :    
exec('C:\Users\Anton\AppData\Local\Temp\SCI_TMP_5144_\LOAD_INTO_SCILAB-6477721663385113459.sce',
1)
while executing a callback







--
View this message in context: http://mailinglists.scilab.org/Puzzling-behaviour-ignoring-Invalid-index-error-tp4025701.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list