[Scilab-users] function find()

grivet grivet at cnrs-orleans.fr
Tue May 27 13:49:25 CEST 2014


Hello,
While trying to compute pairwise distances between random points, I have 
come across
a behavior of function find() that I don't understand. I do the following:

// initialisation
diam = 0.2;
nd = 10;
etat = (rand(nd,2) -0.5)*4;
distance = zeros(nd,nd);
//compute distance matrix
for i = 1:(nd-1)
     for j = (i+1):nd
         distance(i,j) = 
sqrt((etat(i,1)-etat(j,1))**2+(etat(i,2)-etat(j,2)**2));
     end
end
//find close pairs
[li,lj] = find(distance<diam)

With both Scilab 5.4.1 and Scilab 5.5, the last line raises the error 
message:
                          !--error 144
Opération non définie pour les opérandes données.

I will be grateful to anybody who spots my error.

Thank your for your time,
JP Grivet



More information about the users mailing list