Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Deleting elements from list in loop' topicStudent Support Forum > General > "Deleting elements from list in loop"

Next Comment >Help | Reply To Topic
Author Comment/Response
Marcin G.
12/10/11 4:52pm

Hello,
I try to delete elements from a list in Do loop.

I prepared the following list:
mylist = {}
AppendTo[mylist, 6]
Do[Print[i] mylist = {}, {i, 1, 10}]
mylist

The problem is:
Set::write: "Tag Times in Null\ {3} is Protected"

It hasn't deleted any element from the list (I have the same problem using Drop command).

The problem doesn't occur if I Drop or initialize again list out of loop.

Thank you,

URL: ,

Subject (listing for 'Deleting elements from list in loop')
Author Date Posted
Deleting elements from list in loop Marcin G. 12/10/11 4:52pm
Re: Deleting elements from list in loop Nasser M. Ab... 12/13/11 04:09am
Next Comment >Help | Reply To Topic