# Questions tagged [code-request]

Questions on finding existing Mathematica implementations or expertise to address a clearly stated problem.

419 questions
Filter by
Sorted by
Tagged with
42 views

### How to find All Solution of a equation? [closed]

How to get ALL solutions of the equation tanh x = 135 x. What is the command?
151 views

### How to speed up the calculation of recurrence formula?

I have a recurrence formula. How to quickly solve P[1] to p[49]? ...
• 107
91 views

### Creating a list from the word cloud

So, the WorldCloud function applied to a string generates a word cloud graphic in which each word is sized according to its multiplicity in the string. Is there a ...
158 views

### Define a new rule for multiplication

I am trying to implement a new rule for noncommutative multiplication: $$x * q^n * y \to q^n * x * y,$$ where $\ast$ stands for noncommutative multiplication and x and y are random products in ...
• 45
62 views

### How do we define the function near the end of my post?

Suppose I have two sets $F_{1,n}$ and $F_{2,n}$ written as: ...
• 199
192 views

### Implementing fast linear search for perfect vertical image alignment

After experimenting with image alignment aprroaches presented here and here and some other approaches involving ImageDistance and ...
• 55.7k
80 views

• 483
36 views

### Simplify or Solve in term of some expressions (again) [duplicate]

Suppose x=a, y=ad-bc, z=ade-bce-fga Obviously, z = (ad-bc)e-(fg)a = e(y)-fg(x) I want to get the output to be z = e(y)-fg(x) I have tried Solve[{x==a, y==ad-bc, z==ade-bce-fga},z,{a,b,c,d}] as some ...
• 95
1 vote
60 views

### How to create a flexible BarChart[ ] with Manipulate[ ]

This question is nothing more than making a few changes to an already working code. I put that code into Manipulate[...] to be able to choose a subset of countries ...
• 4,391
95 views

### An example code for doing a loop [closed]

I would like a code that works for doing loops as in the toy example below. This would help me to understand how to work with loops in more general contexts as I am still a beginner in Mathematica. ...
• 207
40 views

...
• 199
1 vote
71 views

### How to dynamically link a bar chart to a table and present them in a single synchronized figure

This answer has addressed the question of presenting a bar chart and its data table together in a single figure. Not to repeat the same question, I should point out that the answer given is not ...
• 4,391
326 views

### Sum a number's digits until only one digit remain

I want to iteratively calculate the sum of a number's digits, until the result contains only one digit. For example, when $n=67946$ we get: $$6+7+9+4+6=32\space\to\space3+2=5\tag1$$ So, when $n=67946$ ...
• 1,723
1k views

### Making the number 12345...n

Well, I am trying to write a code that makes the number: $$123456\dots n\tag1$$ So, when $n=10$ we get: $$12345678910$$ And when $n=15$ we get: $$123456789101112131415$$ And when $n=4$ we get: $$1234$$...
• 1,723
1 vote
53 views

### combine those $n$ lists without specifying whole $n$ sets explicitly?

Suppose I have $n$ lists, How to combine those $n$ lists without specifying whole $n$ sets? I mean; For a given lists list1={{3, 1, 1}, {1, 3, 1}, {1, 1, 3}} list2={{2, 2, 1}, {2, 1, 2}, {1, 2, 2}} ...
• 335
117 views

### For a given set, how to get rid of the some particular set?

Consider the following decomposition list of $\{a1,a2,a3,a4\}$ into three parts as $t$, t={{{a1, a2}, {a3}, {a4}}, {{a1}, {a2, a3}, {a4}}, {{a1}, {a2}, {a3, a4}}, {{a1, a2}, {a4}, {a3}}, {{a1}, {a2, ...
• 335
157 views

### How to reformat a Dataset[]

I have a dataset jdataSDG1 and like to reformat it as jdataSDG2. ...
• 4,391
70 views

### Export list of elements to .txt file

Well, I have the following Mathematica output (as an example): {3,6,7,12,45,67,89,101,349,692} And I am looking for a code that can export this to a .txt file that ...
• 1,723
32 views

### Making a binary number $n$ that must contain $k$ times a $1$ such that k==GCD[n,IntegerReverse[n]]

Well, I am trying to code the following thing in Mathematica: I have a binary number $n$ that must contain $k$ times a $1$. So for example: when $k=5$ the following binary numbers does fit the rule: ...
• 1,723
1 vote
80 views

### Mathematica Table

I would like to do a table as shown in Mathematica but I am not sure the code that I need to use for that. Any help will be highly appreciated. Thank you
1 vote
73 views

### Solving a system of equations using a list of possible solutions

Well, I have for example the following input and output of a code: ...
• 1,723
83 views

### Removing a element from list when obeying a certain condition

Well, I have the following code: Select[PowersRepresentations[n, a, b], DuplicateFreeQ[#] && ! MemberQ[#, 0] &] This code finds ...
• 1,723
1 vote
72 views

### What does Sin[2. x] mean? [closed]

I am working with a particularly long function that, when I want to evaluate it at a certain $x$, shows: As you can see there are expressions herein of the form Sin[2. x] or Cos[2. x]. What do these ...
1 vote
54 views

...
• 43
147 views

### Find centroid point which depends on time and plot it in animation along with curve?

Given a partial differential equation, we can NDSolve for its solution. In my case I got a function of three variables $u(t,x,z)$. I wish to study the case when we restrict $z=0$. Most importantly, I ...
• 43
1 vote
76 views

### how to draw a line at mean value of cross-section and time-series data using Bar Chart

I have Dataset; ...
• 4,391
1 vote
83 views

### how to perform operations on a subset of a dataset

I have this data set: ...
• 4,391
1 vote
56 views

### Data parallelism for independent probabilistic trials

I'm considering the best way to implement the data parallelism features of Mathematica for a specific task. To that end I have a minimal code example below which contains the basic features of my ...
• 271
141 views

### How to convert a dataset into an alternative format

I have the following dataset: ...
• 4,391
251 views

### how to make BarCharts or Line Plot based on specific identifiers in a Dataset over two years

Given the following datasets: ...
• 4,391
75 views

### How to plot different dependent varaibles against the same independent variable

Let's say I have a dispersion relation $\omega=\exp{k}$, how should I write a mathematica code to ask for plots of $\omega$ against $k$ as well as the phase speed $\omega/k$ against $k$ for a range of ...
• 43
1 vote
98 views

### how to use an unformatted database imported from Excel into Mathematica and draw various charts

In my earlier question (in this link) the given database is nicely formatted with columns denoting data for variables across countries and years. But, data sets are not always nicely formatted. Here ...
• 4,391
53 views

### What does tag plus protected mean in this case? [closed]

I am trying to define a function for future NDSolve use oweqn = (1/(c)^2) D[y[t, x], {t, 2}] - D[y[t, x], {x, 2}] + k1 y[t, x] = 0 Where I predefined $c$ to be a ...
• 43
126 views

### how to efficiently use a time series database to plot Barcharts or LinePlots

I have the following input: ...
• 4,391
49 views

### How to specify range in an implicit relationship with variable?

Here is the plot I want to do: ContourPlot[3 Abs[x] y (y^2/x^2 - 1/3) - 2/(Abs[x] y) == 3 Sqrt[1 - y^2/x^2], {x, -20, 20}, {y/x, 1/Sqrt[3], 1}] However when I ...
• 43
149 views

### How to draw a barchart with a vertical line

The following code works just fine with a few caveats. ...
• 4,391
72 views

### Mathematica package for computing Macdonald polynomials

I want to implement computation of Macdonald polynomials in mathematica. A similar question was raised in another question 5 years ago (Macdonald-Koornwinder polynomials?), but received no clear ...
• 133
38 views

### FoldList type evaluation for multivariable function

In the example code which follows I define a two variable conditional function h[_i, _v], one variable denotes the integer index i, and the other is an N-dimensional vector v (I denote dimension 'N' ...
• 271
85 views

### how to plot multiple plots sharing a common X-axis and Y-axis

With the following Code, I generate various ListLinePlots but I like to create the example ...
• 4,391
1 vote