RazamRM

10 Reputation

One Badge

1 years, 111 days

MaplePrimes Activity


These are questions asked by RazamRM

I need help trying to remove some null elements from a listlist, that i converted from an Array. 

Example: I have a list of coordinates r:=[[1,2],[1,3]], which i converted to an array, and nulled the first element.

r:=convert(r,Array): 
r[1]:=NULL:
r:=convert(r,listlist):

I now have r=[[],[1,3]] after converting it back to a listlist. How do i remove the first element, which is an empty entry, such that i end up with r=[[1,3]]

Thanks 

I keep getting an error: invalid subscript selector on specifically this part of my code:

MuligIndgange := subsop(RemoveList\[i\]=NULL, MuligIndgange).
Whenever I comment out the MuligIndgange := part it works.

I can't for the life of me see why it's happening, and whenever I use this code outside my proc it works aswell.

Any help is appreciated, and if you need more context I'll be happy to give it.

for i to numelems(MuligIndgange) do
     if M1[MuligIndgange[i][1], MuligIndgange[i][2]] =/= 0 then
         RemoveList := [op(RemoveList), i];
      end if;
end do;
for i from numelems(RemoveList) by -1 to 1 do
    MuligIndgange := subsop(RemoveList[i] = NULL, MuligIndgange);
end do;

Page 1 of 1