Question: Trimming an array

Hi friends, In my maple procedure I m calculating large amount of point then I m plotting them. Although I don’t know how many points will be calculated, I have a logical upper bound for number of points. I was using the method 1: for i from 1 to N do if something is okey then x := ... y := ... data := [op(data), [x,y]]: end if; od: but I have relalized that this is really slow. Then I started to use Method 2: data := array(1..N): j := 0; for i from 1 to N do if something is okey then x := ... y := ... j := j + 1; data[j] := [x,y]: end if; od: Unfortunately, when I tried to plot the data obtained by 2nd method. Plot command generated an error because there are some nonnumeric values such as data_12,data_13,etc. So I want to use only fist j elements of the array. I try to use ArrayTools package but I havent found suitable command. Is there any practical way to trim last N-j elements (Of course I can transfer first j elements to another array)? Thanks...
Please Wait...