Quick query re: your code, How is the index (i) defined? i = [5 8 2 3 5 8 2 6 5 8 3 7 5 2 3 1 2 3 8 4]'; Just trying to fully understand your method. Lester -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html