0
|
5228 Views
|
7 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# mathematica command

Posted 9 years ago
 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:= ?// Postfix[f[expr]] prints with f[expr] given in default postfix form: expr//f. Postfix[f[expr],h] prints as exprh.  >> In:= (* Postfix *) {x1, {x2, {x3, {x4}}, x5, {x6, {x7, {x8}}}}, x9} // Flatten Out= {x1, x2, x3, x4, x5, x6, x7, x8, x9} In:= (* Prefix *) Flatten[{x1, {x2, {x3, {x4}}, x5, {x6, {x7, {x8}}}}, x9}] Out= {x1, x2, x3, x4, x5, x6, x7, x8, x9} In:= (* Prefix *) Flatten @ {x1, {x2, {x3, {x4}}, x5, {x6, {x7, {x8}}}}, x9} Out= {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:= 45 \[Degree] // Cos Out= 1/Sqrt In:= 45 ~ Times ~ Degree // Cos Out= 1/Sqrt 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:= 7 ~ Plus ~ (5 // Minus) Out= 2 In:= 1~Plus~2~Plus~3~Plus~4~Plus~5 == Plus @@ Range == Plus[1, 2, 3, 4, 5] Out=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:= Flatten[{{a, b}, {c, {d}, e}, {f, {g, h}}}] Out= {a, b, c, d, e, f, g, h}