Questions tagged [core-language]
Questions on the basic structure of the Mathematica language (Wolfram language) including atomic data types, syntax etc
626 questions
3
votes
1
answer
221
views
What is the meaning/utility of __[] AKA BlankSequence[][]?
I understand BlankSequence in other contexts, but not this one __h means a pattern of one or more things each of which have head ...
2
votes
1
answer
145
views
Receiving messages quietly
I recently learned about the possibilities of EvaluationData, and would like to analyse for example
the behavior of NIntegrate.
...
1
vote
0
answers
78
views
Are all Atoms created equal? Are there natural categories for atomic elements? [duplicate]
Certain Atoms (by which i mean things for which AtomQ gives True), like Complex, and even ...
3
votes
3
answers
243
views
Versatile way to show points array
I often work with point processes and need simple graphical representation of points.
Processes are investigated in all three dimensions, so arrays of points look like that:
...
8
votes
1
answer
472
views
What's happening when we execute a_b=1?
OK, of course I know that, as mentioned in e.g. here, symbol names in Mathematica cannot contain underscore _ because it's a reserved character, but, what's ...
3
votes
2
answers
281
views
Using List as independent variable of function leads to mysterious output
I was running into a strange error that boils down to this
Myfunction[List_]:= Transpose[{List}]
Test = {1, 2};
Myfunction[Test]
The output is
...
9
votes
2
answers
978
views
Why f[x___] := {x==="To be", x=!="not to be"} is both True for f[]?
The behavior of pattern matching in functions surprised me at the
unexpected behavior of this example
...
4
votes
1
answer
195
views
Head of functions and symbol confusion
I am having trouble understanding how functions work in mathematica. Consider the following.
...
9
votes
2
answers
469
views
How do I display any given expression in postfix notation rather than the standard notation?
My example is
f[f[f[startValue, 1], 2], 3]
which I would like to display as
f[startValue, 1] // f[#, 2]& // f[#, 3]&
...
2
votes
3
answers
468
views
Circular values with Mathematica
In the process of modelling the interaction of charged particles on circle I encountered s.c. circular values calculations.
Consider unit circle and set some point $O$ as starting.
The position of any ...
2
votes
2
answers
150
views
Securing the function definition containing CircleTimes
I'm trying to create a function that handles operators. The only thing left to do is implement the commutator. The minimal working example of func is
...
3
votes
1
answer
172
views
Nearest without element itself
Is there a smart way to get nearest (given number num to given element elem) elements of list,
except element itself?
This works ...
3
votes
3
answers
506
views
Using Out (%) with control flow
I make heavy use of Out in Mathematica's notebook environment. When I get a computation to work, it will often be spread across multiple cells and lines with ...
3
votes
1
answer
97
views
BinCounts: force/block SparseArray output
BinCounts sometimes outputs data as SparseArray, and sometimes Normal.
This does not depend ...
4
votes
0
answers
107
views
Why doesn't NMaximize handle this improper function definition?
First, consider this toy example:
expr = (1 - x)/(x^2 + y^2);
Clear[f];
f[x_?NumericQ, y_?NumericQ] := expr
"Wait, this function definition is wrong! "...