Questions tagged [built-in-symbols]
Questions related to handling built-in symbols and functions, for example why they behave a certain (possibly unexpected) way.
239
questions
3
votes
1
answer
110
views
Factor gives non-factorized result
The Factor built-in function is usually idempotent, namely applying it twice gives the same result. However, in the following example it is not. Is that expected? ...
0
votes
0
answers
41
views
Palette that gets single keystroke as input
I could find many examples of user-made Palette with many buttons in it.
And drawing-tools Palette is not user-made, but it accepts a single keystroke as input.
(In ...
1
vote
0
answers
35
views
"ParticleData[] " command $Failed
I am using Mathematica version 13.2. I am trying to use Mathematica's "ParticleData" command to get the information about the particles directly from PDG. But, whenever I am trying to ...
0
votes
0
answers
93
views
How to use Switch for more than one switchable arguments (in a compilable way)?
Consider some example of usage of the function Switch:
...
7
votes
1
answer
123
views
Get All Discrete Univariate Distributions with Symbolic Parameters
I am trying to get all Discrete Univariate Distributions with symbolic arguments from any place in Wolfram Language system. For example this guide:
http://reference.wolfram.com/language/guide/...
3
votes
1
answer
209
views
Test whether an expression contains a particular pattern
How to test whether an expression contains a particular pattern ?
I made a function for myself that tests whether an expression contains Plus or not.
...
3
votes
1
answer
75
views
Basic question Sort criteria
Can you explain the following codes? (output of codes)
I know that
there is the default ordering for any expression in Mathematica
and Sort uses the default ...
1
vote
1
answer
94
views
Why do some functions, or at least, PowersRepresentations, run far faster on subsequent calls? What determines this behaviour?
Say I run the following:
PowersRepresentations[4782969,4,2]
and it takes about 2 minutes. If I call it again it takes only about 0.0005 seconds.
What determines ...
2
votes
1
answer
83
views
Defining function for decimal value k[0.5+0.5]
k[1 + 1] = 2;
k[1 + 0.5] = 1.5;
k[0.5 + 0.5] = 1;
{k[2], k[1.5], k[1]} // TableForm
2
1.5
k[1]
Can you explain this phenomenon? I think the output should be
...
8
votes
1
answer
348
views
What is MergeDifferences?
My version is 13.2.0 for Mac OS X ARM (64-bit) (November 18, 2022).
The symbol MergeDifferences appears in the auto-completion
...
12
votes
2
answers
331
views
How can I create a shortcut to convert "normal Symbol" to Formal Symbol?
I'd like to create a shortcut to convert a selected symbol, say \[Delta], into its rough equivalent formal symbol (i.e., ...
1
vote
1
answer
102
views
Need a few built-in Symbols (functions) whose Options are a mix of Rule-s and DelayedRule-s [closed]
This is for examples in documentation I'm writing for a ResourceFunction["PrettyOptions"] (look for it soon) that is close to completion. Asking for most ...
2
votes
1
answer
75
views
`SequencePosition` doing unnecessary work
SequencePosition returns only the first sequence in a list that matches a given pattern with
SequencePosition[list,pattern,1]
...
2
votes
2
answers
112
views
Write an expression that queries all of MMA to find the top M Symbols with the most Options or M Symbols having N Options?
I apologize, but I'm way over my pay-grade on this one, so I don't have any code to share that needs correcting. That is because I really don't know how to start this. I feel like this has a very easy ...
0
votes
0
answers
14
views
How to check if a cached expression Once[...] exists to prevent a generated Message of Failed when Unset
I need to occasionally programmatically Unset a Once[expr] expression from within a function without generating an error if the ...
3
votes
0
answers
54
views
ContinuousMarkovProcess built-in function
Is the built-in function ContinuousMarkovProcess in Mathematica is the well-known Gillespie algorithm?
2
votes
1
answer
257
views
How to copy infinity symbol as ∞ and not as \[Infinity]
FromCharacterCode[8734]
(* ∞ *)
No matter how I copy ∞ whether as plaintext or input text or whether it is inside string like <...
0
votes
1
answer
95
views
How to convert a list of indexed variable names to a list of formal symbols?
I have the following list of indexed variable names:
list = {x1,x2,x3,x4};
I would like to build a list of formal symbols from the above list, i.e.
...
9
votes
1
answer
309
views
How to restore the compile function from FunctionCompileExportByteArray
We can compile a function into a ByteArray object:
...
1
vote
1
answer
76
views
Why does my simple string function fail to grab the only element in a List?
The idea is to normalize a string before processing it to extract information from it. Strings may come with embedded outer brackets which are easily stripped or as elements of a true list. This is ...
1
vote
1
answer
83
views
Ensure that Options for built-in symbols are the original defaults
I often create symbols (no args) or functions (with args) in which common options (and styles) are set in body and unique opts within args for managing multiple calls to built-in functions. these spit ...
4
votes
0
answers
37
views
Sequence in superscript
The code DisplayForm@SuperscriptBox[a,b,c] makes a invalid box. It still renders like $a^b$, but it's red with an error message (as it should be).
That being said,...
5
votes
1
answer
140
views
Evaluating PlusMinus to 2 decimal answers
How do I evaluate and expand an expression containing PlusMinus such that:
N[PlusMinus[1, 1]]
returns
2, 0
I'm stuck at ...
0
votes
0
answers
69
views
Packed/Unpacked array - what object/like 0 or 1?/how to check/ [duplicate]
In Mathematica, there is a concept called packed array.
...
5
votes
5
answers
249
views
How to get the action diagram when the group act on a set?
I previously thought the orbital map would achieve this, but as the current answer or discuss in the comment. I realized that was wrong. And the Close behavior advice tells me "Needs details or ...
1
vote
2
answers
141
views
Two questions about `Infinity` [closed]
These are 2 small questions about Infinity. They are not related each other.
Q1)
...
6
votes
6
answers
611
views
Grouping consecutive elements at specified positions
Let
L1={1,2,4,6,8,9,10,14,15,17,21,22,72,76,80,96,106,116,117}
Question1) Group from 10-th to 14-th elements in L1.
So that the ...
3
votes
1
answer
116
views
Extracting list structure from nested list
Can we construct a function f, g in mathematica such that
For any list L,
g[Flatten[L],f[L]] ...
1
vote
2
answers
76
views
Theoretical Timing possible? (not changes for each evaluation)
Is there a method to measure theoretic time load (hope +theoretic memory load) of an evaluation?
They should not change - always generate same value after pressing Enter key(=evaluation).
Hope they ...
9
votes
4
answers
449
views
Construct a pure function containing built-in 'Sequence'
I guessed the output for
(Sequence[#, 7]&)[3]
should be
Sequence[3,7]
But my guess was wrong. See the screenshot:
And I ...
2
votes
1
answer
353
views
1
vote
1
answer
268
views
The square of Abs of a complex number
We all know that
4^2 + 22^2 = 500
Is there a natural way to generates 500 from the complex number ...
0
votes
0
answers
81
views
Calculate the "intersection" for the given case?
Consider the following task:
There are two cross-sections: the first one is located in the $yz$ plane (the case 1), and the second one is in the $xy$ plane (the case 2). In the spherical coordinate ...
6
votes
1
answer
146
views
What is the purpose of StrokeForm?
Symbol System`StrokeForm is present already in Mathematica version 8 (but not in version 5.2).
Currently, it is used in built-in themes, for example:
...
0
votes
1
answer
57
views
Using the symbol of the system of equations [duplicate]
Part 1
I'd like to know how to use the symbol of system of equations (left curly braces). I tried the following code:
Part 2
How can I add a third equation?
1
vote
1
answer
531
views
Symbol of system of equations
I'm wondering if there is a way to use the symbol (the left curly bracket) of a system of equations. So far I found only the following "symbol":
I need to remove the two conditions.
EDIT2: ...
2
votes
1
answer
81
views
Is there a comprehensive list of most common or most important native Message-s (w/tags) for errors and Failed?
Yes I understand how to use Messages[symbol] but that doesn't help much. I have no idea which important ones I may have missed in my search or even how many exist. ...
1
vote
1
answer
64
views
How can I clear the symbol \[ImaginaryJ] for use for another purpose?
By default it is the same as imaginary unit, but I want to use it for split-complex numbers.
1
vote
0
answers
184
views
Separate colours of an image
Since LAB colour space is based on opponent color theory, an image in 'LABColor' is made up of red/green, yellow blue separations.
I am trying to separate an image into its distinct colour components (...
0
votes
2
answers
124
views
NMaximize - global maximum fail - How to?
Problem :
Let x,y,z be non-negative real number whose sum is 1.
Find maximum of 0.2x + 0.2y + x^2*z + y*z^2
What I did first was reducing variable.
...
4
votes
1
answer
331
views
Largest k such that p^k divides n
(Here all variables are integer.)
Is there a built-in function f[n,p] such that
f[n,p] = largest k such that p^k divides n
For ...
2
votes
1
answer
105
views
Can I tell whether a symbol is build-in (part of the System` library)?
I'd like a function that checks whether a symbol is a predefined part of the language or not. More generally, it might check whether it's part of a given package.
...
3
votes
2
answers
148
views
Built-in functions on the LHS won't pattern-match
I have this pattern-matching problem:
F[X_,myminus[X_]]:=0
F[1,myminus[1]]
Works.
...
7
votes
4
answers
415
views
AnyTrue is too good (compared to MemberQ)
Let L be a list of integers, and ⓝ denote an explicit integer.
I've thought the most natural way to tell whether ⓝ belongs to L is
In[1] MemberQ[L, ⓝ]
But there ...
3
votes
0
answers
58
views
Definition of large expression - makes PC freezed
In[1] A=Range[10^4];?A
Out[1] (* definition of A*)
It works for 10^4. But if I increase the number to 10^6
...
2
votes
1
answer
80
views
Construct really identical function (the same as Length)
In[1] Length[Unevaluated[1 + 1 + 1 + 1]]
Out[1] 4
Q1) Can we construct a function named f, such that ...
0
votes
0
answers
97
views
Check an input matrix M contains any nonzero diagonal matrix element or not
Is there a way to easily check an input matrix M contains any nonzero diagonal matrix element or not?
For example,
if the M contains any nonzero diagonal matrix element, Output: True.
if the M ...
2
votes
2
answers
226
views
Get list of special characters
I recently found that \[Gradient] and \[InlinePart] both expand (contract) to special symbols in MMA.
So far as I can tell (see ...
1
vote
0
answers
88
views
Is there a function in Mathematica to combine/decompose sinusoids? [closed]
Lets say I have some combination of an arbitrary number of sinusoids with potentially varying magnitudes, phase angles and frequencies that I would like to compose into a singular sinusoid, is there a ...
0
votes
0
answers
47
views
How to reconstruct a complicated built-in function (e.g. for modification or use in a version that does not have it yet) [duplicate]
Is it possible to extract the definitions for a built-in function to reconstruct a similar user defined function. This would be useful to port new mathematica functionality to older versions or to ...