Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.1K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Use Append in this sample code?

Posted 8 years ago

The first Append doesn't work, but the second does. The difference is the semicolon. I don't understand this.The problem doesn't depend on Append. The same phenomenon occurs with Union or Insert. I overlook something.

points = {{0, 0, 0}, {1, 1, 0}, {0, 1, 1}, {1, 0, 1}};

In[266]:= pointsums = {}

Out[266]= {}

In[267]:= Append[pointsums, points[[2]]];

In[268]:= pointsums

Out[268]= {}

In[269]:= Append[pointsums, points[[2]]] pointsums

Out[269]= {{1, 1, 0}}

Attachments:
POSTED BY: Peter Giesecke
5 Replies
Posted 8 years ago

forget it, I see it

POSTED BY: Peter Giesecke
Posted 8 years ago

forget it, I see it

POSTED BY: Peter Giesecke
Posted 8 years ago

forget it, I see it

POSTED BY: Peter Giesecke

It seems that you expect from Append the behaviour of AppendTo. Take a minute to look them up.

POSTED BY: Gianluca Gorni
POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard