Questions tagged [built-in-symbols]

Questions related to handling built-in symbols and functions, for example why they behave a certain (possibly unexpected) way.

Filter by
Sorted by
Tagged with
1 vote
1 answer
55 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 ...
user avatar
  • 1,837
1 vote
1 answer
67 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 ...
user avatar
  • 1,837
4 votes
0 answers
31 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,...
user avatar
  • 2,688
5 votes
1 answer
113 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 ...
user avatar
0 votes
0 answers
66 views

Packed/Unpacked array - what object/like 0 or 1?/how to check/ [duplicate]

In Mathematica, there is a concept called packed array. ...
user avatar
  • 2,877
4 votes
4 answers
214 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 ...
user avatar
  • 23.7k
1 vote
2 answers
112 views

Two questions about `Infinity` [closed]

These are 2 small questions about Infinity. They are not related each other. Q1) ...
user avatar
  • 2,877
6 votes
6 answers
325 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 ...
user avatar
  • 2,877
3 votes
1 answer
75 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]] ...
user avatar
  • 2,877
1 vote
2 answers
74 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 ...
user avatar
  • 2,877
9 votes
3 answers
367 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 ...
user avatar
  • 2,877
2 votes
1 answer
326 views

Using < or <= make different results when sort

...
user avatar
  • 2,877
1 vote
1 answer
129 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 ...
user avatar
  • 2,877
0 votes
0 answers
70 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 ...
user avatar
  • 3,832
6 votes
1 answer
113 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: ...
user avatar
0 votes
1 answer
42 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?
user avatar
0 votes
1 answer
103 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: ...
user avatar
2 votes
1 answer
77 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. ...
user avatar
  • 1,837
1 vote
1 answer
49 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.
user avatar
  • 2,751
1 vote
0 answers
130 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 (...
user avatar
  • 7,759
0 votes
2 answers
94 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. ...
user avatar
  • 2,877
4 votes
1 answer
287 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 ...
user avatar
  • 2,877
2 votes
1 answer
88 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. ...
user avatar
3 votes
2 answers
129 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. ...
user avatar
7 votes
4 answers
380 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 ...
user avatar
  • 2,877
3 votes
0 answers
56 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 ...
user avatar
  • 2,877
2 votes
1 answer
72 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 ...
user avatar
  • 2,877
0 votes
0 answers
53 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 ...
user avatar
2 votes
2 answers
136 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 ...
user avatar
  • 2,688
1 vote
0 answers
79 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 ...
user avatar
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 ...
user avatar
  • 3,603
8 votes
1 answer
474 views

very simple but unexpected aspect of Function[ ]

I've always thought (2#+1)& and Function[x,2x+1] are interchangeable in common sense. But, ...
user avatar
  • 2,877
0 votes
0 answers
66 views

Find fit for 3D data

Consider some dataset in the form {x,y,data[x,y]}: ...
user avatar
  • 3,832
0 votes
0 answers
45 views

What could go wrong in redefining Power to act on functions?

Inspired by a tweet (from a locked account, unfortunately, so I can't link it), we can get notation like $\cos^2(x)$ to work in Mathematica in general: ...
user avatar
  • 8,208
1 vote
1 answer
70 views

How to define distributivity of CenterDot on bras and kets

I am working on a code for a coupled quantum harmonic oscillator and found myself in a hiccup when trying to evaluate the inner product of linear combinations of bras and kets. I have initially ...
user avatar
  • 13
3 votes
1 answer
79 views

How to arrange two tables in the following way?

Consider two tables: ...
user avatar
  • 3,832
16 votes
1 answer
298 views

Head[x] vs x[[0]]

Can we say Head[x] and x[[0]] are identical ? In mathematica manual I could find : 'The head is the part with index 0' But I am not sure whether Head[x] are x[[0]] are really interchangeable in any ...
user avatar
  • 2,877
2 votes
2 answers
69 views

A condition for the given point to be included in the domain?

If we have two domains, it is possible to check whether one domain is inside another domain: ...
user avatar
  • 3,832
3 votes
2 answers
97 views

A condition for one domain to be included in another domain?

Consider two domains: domain1 = Rectangle[{-2.5, -2.5}, {2.5, 2.5}]; domain2[R_] := Disk[{0, 0}, R] I would like to check whether the second domain is completely ...
user avatar
  • 3,832
2 votes
1 answer
113 views

How to find the area of circle inside the rectangle?

Consider a circle located at the origin circ[R_] := Circle[{0,0},R] and an arbitrary rectangle ...
user avatar
  • 3,832
0 votes
0 answers
57 views

Dot Product doesn't behave like normal function

I am trying to slightly modify the Dot function by treating it like a usual function, but soon I notice something weird about it. Suppose there is a set ...
user avatar
  • 381
5 votes
1 answer
79 views

Counting the number of edges between two graph partitions

Consider the following: g = RandomGraph[WattsStrogatzGraphDistribution[1000, 0.1, 5]] comm = FindGraphPartition[g, 2]; CommunityGraphPlot[g, comm] ...
user avatar
  • 55
2 votes
1 answer
154 views

How &@ and &/@works?

I have the following expression: (Join[#, Reverse[#, {2}]] &@Partition[#, 2, 1, 1]) & /@ Vec (* where: *) Vec={{2,0},{1,1},{0,2}}, but I am not sure how ...
user avatar
  • 657
2 votes
3 answers
370 views

Compare all elements of a set with a specific number and return 1 or 0

Say I generate a set of 20 random numbers by x=RandomReal[{0, 1}, 20], I want to compare every element of x with 0.4. If it is less than or equal to 0.4, then return 1; if it is greater than 0.4, then ...
user avatar
0 votes
0 answers
63 views

Avoiding Tables, Do and other loop construction

In my work I have a lot of cases, where I should calculate non-listable functions for a quite large number of points. To be more concrete, consider first listable function ...
user avatar
1 vote
0 answers
92 views

How to figure out syntax for symbols?

I'm new to Mathematica and am having a hard time figuring out how to type certain symbols when I read the documentation. For example, in https://reference.wolfram.com/language/ref/...
user avatar
  • 43
16 votes
3 answers
982 views

Which function names have been re-purposed in Mathematica after being deprecated?

I have just learned about the new function Splice from this answer. It turns out that this function used to have a completely different usage! (See below.) To me, ...
user avatar
  • 21.6k
11 votes
1 answer
464 views

Finding year that MMA functions were introduced via programmatic calls in the Wolfram Language [duplicate]

Is there a way to find the year that MMA functions were introduced via programmatic calls in the Wolfram Language? I would like to be able to create and manipulate such a list or dataset.
user avatar
4 votes
0 answers
44 views

What built-in functions have bad time/space complexity and their alternatives?

It's surprising that Join is $\mathcal{O}(n)$ (due to copy) while I've been using it as a convenient way to join lists together. It also reminds me of suggestions ...
user avatar
  • 1,950
3 votes
1 answer
124 views

How can I prevent TabView from resetting the current tab?

This is a simplification of a problem that has arisen in a project regarding Euclidean activities for verifying proportions via operations on pairs of magnitudes. In the project, the LocatorPane is ...
user avatar
  • 16.3k

1
2 3 4 5