Skip to main content

Questions tagged [core-language]

Questions on the basic structure of the Mathematica language (Wolfram language) including atomic data types, syntax etc

Filter by
Sorted by
Tagged with
4 votes
1 answer
226 views

I understand BlankSequence in other contexts, but not this one __h means a pattern of one or more things each of which have head ...
Tapiocaweasel's user avatar
2 votes
1 answer
145 views

I recently learned about the possibilities of EvaluationData, and would like to analyse for example the behavior of NIntegrate. ...
lesobrod's user avatar
  • 2,590
1 vote
0 answers
78 views

Certain Atoms (by which i mean things for which AtomQ gives True), like Complex, and even ...
Tapiocaweasel's user avatar
3 votes
3 answers
243 views

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: ...
lesobrod's user avatar
  • 2,590
8 votes
1 answer
472 views

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 ...
xzczd's user avatar
  • 71.6k
3 votes
2 answers
281 views

I was running into a strange error that boils down to this Myfunction[List_]:= Transpose[{List}] Test = {1, 2}; Myfunction[Test] The output is ...
Charles Chen's user avatar
9 votes
2 answers
978 views

The behavior of pattern matching in functions surprised me at the unexpected behavior of this example ...
Somos's user avatar
  • 5,252
4 votes
1 answer
195 views

I am having trouble understanding how functions work in mathematica. Consider the following. ...
EEH's user avatar
  • 146
9 votes
2 answers
469 views

My example is f[f[f[startValue, 1], 2], 3] which I would like to display as f[startValue, 1] // f[#, 2]& // f[#, 3]& ...
PaulCommentary's user avatar
2 votes
3 answers
468 views

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 ...
lesobrod's user avatar
  • 2,590
2 votes
2 answers
150 views

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 ...
hlediks's user avatar
  • 499
3 votes
1 answer
172 views

Is there a smart way to get nearest (given number num to given element elem) elements of list, except element itself? This works ...
lesobrod's user avatar
  • 2,590
3 votes
3 answers
506 views

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 ...
Diffycue's user avatar
  • 1,973
3 votes
1 answer
97 views

BinCounts sometimes outputs data as SparseArray, and sometimes Normal. This does not depend ...
lesobrod's user avatar
  • 2,590
4 votes
0 answers
107 views

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! "...
xzczd's user avatar
  • 71.6k
6 votes
2 answers
315 views

Is there a built-in way to combine two Tabular objects? i.e. combining them without converting one of the tabular objects into a 'normal' form? I am currently doing: ...
IntroductionToProbability's user avatar
14 votes
1 answer
346 views

There's a change in the outputs of Table[] and Range[] in V14.2 (compared to V14.1) on MacOS ARM when iterating through machine ...
Michael E2's user avatar
  • 259k
0 votes
2 answers
298 views

I'm curious whether the Mathematica language has some simple way to manipulate expressions without triggering evaluation, at least not without lots of thought and careful debugging. One method is to ...
J Tyson's user avatar
  • 142
0 votes
1 answer
201 views

Suppose several lists X, Y, Z, ... all have the same length, and f is a function. The command Table[f[X[[i]], Y[[i]], Z[[i]]], {i, 1, Length[X]}] is inelegant, but ...
J Tyson's user avatar
  • 142
5 votes
5 answers
315 views

For the study of geometric iterations I needed an algorithm convert a triangle to some standard form. It can be described as follows: Determines the longest side (or any of them) One of its vertices ...
lesobrod's user avatar
  • 2,590
0 votes
1 answer
154 views

The origin of this question is described here, but there are many details, distracting from the main topic. I did not remove the old question so that the interested ones could see the geometrical ...
lesobrod's user avatar
  • 2,590
0 votes
1 answer
131 views

Playing with Geogebra, I became interested in the iterative process of constructing orthic triangles. For a right-angled triangle, the orthic triangle is degenerate, it’s a segment. For any other ...
lesobrod's user avatar
  • 2,590
3 votes
0 answers
97 views

I notice this when exploring this question, I think it's better to start a new question for it. Consider this toy example: ...
xzczd's user avatar
  • 71.6k
5 votes
1 answer
205 views

Let's say I want to take this plot: r = 3; DensityPlot[x^2 + y^2, {x, -r, r}, {y, -r, r}] and make the x and y limits be returned from some function (maybe because ...
dalamajama's user avatar
6 votes
7 answers
557 views

Is there any way to make cyclic loop over array without PadLeft,PadRight, ArrayPad? So ...
lesobrod's user avatar
  • 2,590
2 votes
1 answer
161 views

Let we have $(2\cdot r+1) \times (2\cdot r+1)$ matrix mat. Is there a better way to extract it's central element, rather than ...
lesobrod's user avatar
  • 2,590
0 votes
0 answers
123 views

I am trying to add my definitions to FormulaData and looking through the source files It is clear that one can do that systematically by adding some DownValues to system functions and elements to ...
Felipe's user avatar
  • 729
4 votes
3 answers
277 views

I’m interested in multi-state CA in a closed 2D space and try to implement them using CellularAutomaton but do not understand how to do it. The first question is, ...
lesobrod's user avatar
  • 2,590
0 votes
0 answers
133 views

Seems that I may have found a pair of exact solutions to the logistics map with cycles of period three. However, I’ve run into a bit of a snag in proving it because of some “ambiguities” in the ...
Steersman's user avatar
10 votes
1 answer
215 views

Values of a list can be added to an association's values like so, ...
Carl Verdon's user avatar
3 votes
7 answers
534 views

This feature has long troubled me, I would like to share it. If Reap has non-empty set of sown, result looks like: ...
lesobrod's user avatar
  • 2,590
1 vote
0 answers
95 views

In the spirit of this interesting article of Stephen Wolfram I also decided to study some issues related to mutations. I’m working with simple {0,1} arrays and I’ve ...
lesobrod's user avatar
  • 2,590
0 votes
1 answer
95 views

I have a nested list where all sublists have a length 2, eg: {{1,2}, {1,1}, {3,4}, {3,5}, ...} I need to filter it for two requirements: Delete all sub-lists ...
lesobrod's user avatar
  • 2,590
11 votes
3 answers
1k views

As the title asks, why does b = a; f[a_] := b; f[2] evaluate to a rather than 2?
xzczd's user avatar
  • 71.6k
2 votes
2 answers
194 views

I'd like my function to work only for arrays with all positive members, eg: myf[arr_] := Reverse@arr /; AllTrue[arr, Positive]; So ...
lesobrod's user avatar
  • 2,590
4 votes
5 answers
212 views

I have a function that returns an expression in the form f[{a,b}], and I use this function twice and assemble the expression ...
Tapiocaweasel's user avatar
2 votes
3 answers
231 views

I am having trouble controlling the order of evaluation of mathematica expressions. What I would really like is a general solution, in the form of a pair of functions ...
J Tyson's user avatar
  • 142
2 votes
2 answers
101 views

Let we have an array of integers e.g. Range@365. Each index has a specific value by which clusterization of integers should be done. But these values cannot be ...
lesobrod's user avatar
  • 2,590
4 votes
1 answer
132 views

This is probably trivial and already asked but I did not find it. How to use PatternTest inside Function (...
azerbajdzan's user avatar
  • 32.8k
2 votes
1 answer
125 views

Let we have simple recursive function: ...
lesobrod's user avatar
  • 2,590
5 votes
3 answers
239 views

Can you explain the behaviour of the following? The first With outputs unevaluated If. So in the second ...
three777's user avatar
  • 358
0 votes
3 answers
233 views

Let we try to run this simple code: Minimize[{Cos[x + a/2], {0 <= x <= \[Pi], 0 < a < 1}}, x] It doesn't work. But ...
lesobrod's user avatar
  • 2,590
3 votes
2 answers
82 views

data = {{1, 2}, {2, 2}, {3, 3}}; MinimalBy[data, Norm@# &] Output: {{2, 2}} When applying numerically : ...
lesobrod's user avatar
  • 2,590
7 votes
1 answer
153 views

What is the exact difference between DuplicateFreeQ @ arr and UnsameQ @@ arr ? I checked on many examples and found no ...
lesobrod's user avatar
  • 2,590
5 votes
3 answers
350 views

I am using this from the function repository for which I need to convert one of my functions into a unique form. A simple example is like this: Suppose I have, ...
codebpr's user avatar
  • 3,028
11 votes
2 answers
571 views

A wolfram Tutorial mentions that ReplaceAll and With are similar: The way ...
ions me's user avatar
  • 1,145
7 votes
1 answer
543 views

I saw this thread and upvoted many answers there. Below is the answer by kglr (not my most favorite answer there, but it looks fun). I wonder if anyone could help ...
internet's user avatar
  • 1,417
3 votes
1 answer
135 views

f[x___] := Plus[x, -x] f[Null] gives output as 0 f[] ...
metroidman's user avatar
  • 1,277
4 votes
5 answers
588 views

For some purposes I need to know if there are there any carries in the multiplication of two numbers, especially in base-2. How can we do this in Mathematica? Thanks to all, very interesting answers! ...
lesobrod's user avatar
  • 2,590
2 votes
1 answer
131 views

For a given binary array like {0, 1, 1, 0,..}, I need to find the shortest permutation, sorting it in standard order ...
lesobrod's user avatar
  • 2,590

1
2 3 4 5
13