min of matrices and undefined values

Frederic Jourdin frederic.jourdin at shom.fr
Mon Sep 13 14:03:07 CEST 2010


Scilab versions: 5.2.2 and 5.3.0.beta1

Hi all !

the use of the function "min" in the case:
"m=min(A1,A2,...,An), where all the Aj
are matrices of the same sizes" (see the manual),
appears to me not working when there are
undefined values involved.

For instance, coding:

a= [    1, %nan;    4,    4];
b= [ %nan,    3;    3,    6];
c= [    2,    2; %nan, %nan];
min( a, b, c)

returns the following result:
NaN  NaN
NaN  NaN

when I expected:
1  2
3  4

which seems to me not logical, knowing that the
following simple use of "min":

min( [ 1; %nan; 2])

gives the right answer which is:

1

This appears inconsistent to me. Is it?
thank you
Fred




More information about the users mailing list