Message Boards Message Boards

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

Use Append in this sample code?

Posted 6 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 6 years ago

forget it, I see it

POSTED BY: Peter Giesecke
Posted 6 years ago

forget it, I see it

POSTED BY: Peter Giesecke
Posted 6 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

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your posts and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

enter image description here

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

Group Abstract Group Abstract