# mathematica command

Posted 9 years ago
4969 Views
|
7 Replies
|
0 Total Likes
|
 In a mathematica code...i read the command //Flatten; What is this command?
7 Replies
Sort By:
Posted 9 years ago
 Actually if you type //into the Documentation center you will get the documentation for the Postfix command:http://reference.wolfram.com/language/ref/Postfix.html
Posted 9 years ago
 Thank you!!
Posted 9 years ago
 // is the short form of Postfix. In general Mathematica knows about Prefix, Infix and Postfix. Postfix means the operator or command follows the expression In[1]:= ?// Postfix[f[expr]] prints with f[expr] given in default postfix form: expr//f. Postfix[f[expr],h] prints as exprh.  >> In[2]:= (* Postfix *) {x1, {x2, {x3, {x4}}, x5, {x6, {x7, {x8}}}}, x9} // Flatten Out[2]= {x1, x2, x3, x4, x5, x6, x7, x8, x9} In[3]:= (* Prefix *) Flatten[{x1, {x2, {x3, {x4}}, x5, {x6, {x7, {x8}}}}, x9}] Out[3]= {x1, x2, x3, x4, x5, x6, x7, x8, x9} In[4]:= (* Prefix *) Flatten @ {x1, {x2, {x3, {x4}}, x5, {x6, {x7, {x8}}}}, x9} Out[4]= {x1, x2, x3, x4, x5, x6, x7, x8, x9} start your voyage into Mathematica with an understanding of Evaluation based on the fact that everything is an expression in Mathematica.One can do In[7]:= 45 \[Degree] // Cos Out[7]= 1/Sqrt[2] In[14]:= 45 ~ Times ~ Degree // Cos Out[14]= 1/Sqrt[2] this expression system is based on the fact that there are unary, binary, ternary, .... operators in mathematics. Minus is an unary operator, Plus is a n-ary one In[18]:= 7 ~ Plus ~ (5 // Minus) Out[18]= 2 In[19]:= 1~Plus~2~Plus~3~Plus~4~Plus~5 == Plus @@ Range[5] == Plus[1, 2, 3, 4, 5] Out[19]=True 
Posted 9 years ago
 It' s not Flatten(x) or another command. IT'S ONLY //Flatten; in the reference o documentation center there is no explanation. For example what does it mean // ? So, if you want to help me, link specific post for my problem or if you known it explain it. Thanks.
Posted 9 years ago
 The Documentation Center is your friend.
Posted 9 years ago
 See Flatten in the reference.
Posted 9 years ago
 In[1]:= Flatten[{{a, b}, {c, {d}, e}, {f, {g, h}}}] Out[1]= {a, b, c, d, e, f, g, h} 
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.