test if a value is between two others

Loïc GIROD Loic.Girod at esstin.uhp-nancy.fr
Thu Mar 10 11:56:46 CET 2011


Hi everyone, 

 

I’m trying to test if a value a can be located in an array of values (named
T). As my reference value a can not be really equal to a value in T(i), I
apply a tolerance factor.

So, I have to know if my value T(i) is between a+tolerance and a-tolerance.

 

I’ve tried the following code : 

 

for i=1:size(T)

    if T(i)>=a+tolerance

        then if T(j)<=ae-tolerance then location=i

        end

    end

end

 

I get an error 34 and I don’t understand how to solve it. I’ve tried while
function, but it returns nothing.

 

Could someone help me ?

 

Many thanks

 

Best regards

 

 

Loïc

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110310/ec88c393/attachment.htm>


More information about the users mailing list