# All Questions

501 views

### Why the complicated pattern in this 3D plot?

ListPointPlot3D[ Table[{n, s, (Prime[n]^s/(Prime[n]^s - 1))}, {n, 1, 2000}, {s, 2, 80}], PlotRange -> All] Is the pattern the result of the data, the ...
110 views

### Define a function that takes ragged array [closed]

newbie here. I want to define a function that takes a ragged array and return another one, but how. Say, I want to define a simple function behaves like this ...
60 views

### How to compute variances from a matrix/table

I have created a matrix/table with an imported dataset. I want to know what the variance is for 3 values at a time but across 68 columns. I would like to do this in an automated way rather than 1 set ...
180 views

### Aligning controls and their labels to grid?

I have a Manipulate with 6 sliders controlling 6 different variables. I have labelled them all. The problem is that the labels have different lengths, so it looks a ...
150 views

### Explain the difference between ViewPoint and ViewVector?

I've read the documentation, but am still very unclear as to what the difference is between ViewVector and ViewPoint for ...
78 views

### Linear interpolation over 2 variables

I'm tuning a function to data over 4-5 variables using Differential Evolution. The objective function calls frequently interpolation function. I came to a point, where compiling the objective function ...
613 views

### Undocumented form for Extract

Prompted by a comments conversation here, here's an interesting (and often performance enhancing) use of Extract: ...
98 views

### Removing a ProgessIndicator when no longer needed

I have a progress indicator in my Mathematica notebook that I update as various calculations are performed: indicator = ProgressIndicator[Dynamic[progress]]; I ...
263 views

### A problem with functions and Infinite expression 1/0 encountering

Following code (function) makes integrals and then replace f[x] with Cos functions and calculate the definite parametric ...
122 views

### A problem with set values

The following code is just an example to clearly explain my problem. Assume that : ...
119 views

### How to get mathematica to simplify a result

I have the following output $\text{Li}_2\left(3-2 \sqrt{2}\right)-4 \text{Li}_2\left(-1+\sqrt{2}\right)$. This turns out to be equivalent to $\displaystyle\log^2(1+\sqrt{2})-\frac{\pi^2}{4}$. How ...
221 views

### Another one problem with legends on GraphicsGrid

I have used ListLinePlot to generate this grid of plots: and I want to add a legend in Row Layout below this grid. My code, has as follows: ...
107 views

### An example of how to compute numerically the KL-divergence in mathematica [closed]

I wanted to compute an exact number for two probabilities that I am comparing. These are two normal distributions as: $$Normal(\mu = 5, \sigma = 4)$$ $$Normal(\mu = 5, \sigma = 5)$$ I decided to ...
169 views

### What are these strange shapes in my Plot3D[]? [closed]

Plotting a function, I noticed some strange spots away from the main feature, the dark purple here: You can see that they don't actually have any curvature themselves: Strangely, you don't see ...
148 views

### Making mathematica do regulated integrals

Consider the integration, $\int _0 ^\infty dx\ x \tanh( \pi x) \sqrt {x^2 + a^2 }$ where $a$ is a real number. This integral is divergent. We note that an asymptotic expansion of the integrand ...
173 views

### Making single letters non-italic in Graphics/Text/Style objects

Suppose that I use Graphics, Text, and Style to type one letter in the subscript of a letter ...
1k views

### Scan vs. Map vs. Apply

I cannot understand the difference between Apply, Scan, and Map. I have tried to play with ...
33 views

### How would I enable the Evaluate in place item of the Evaluate menu?

I would like to be able to suppress multiple outputs when a cell is evaluated. Is there a way to enable the "Evaluate in place" menu item of the Evaluate menu?
106 views

### Create new file, based on 500 articles

I've got a folder with 500 newspaper articles. Each article is saved in a seperate file with a number in the title like "1.txt", "2.txt". Each article has a date but it is not clear in which line the ...
286 views

### Map structure of irregular list, Flatten then reconstruct list using structure

I'm trying to use Compile[] to improve the performance of an algorithm. The algorithm works on a set of matrices which are not of a similar shape. Unfortunately ...
208 views

### Recover data points from RGBColor of known ColorScheme

In general I want to recover the z-values from an image of a DensityPlot. A simple example might just be ...
47 views

62 views

### Derive a PDE from other PDEs

I'm trying to do some symbolic calculation like this: Substitute (11.2) into the last two of equations (11.1) and, in turn, substitute these into the first of equations(11.1), I want to ...
138 views

### Shift text upwards in graphics so characters with descenders clear horizontal lines

Is there an option to align Text to automatically adjust for font descent? In the attached graphic, strings that contain "g" are visibly shifted upward, even though all strings are uniformly ...
112 views

### Displaying primes as a 3D array of spheres

I am currently learning my way through Mathematica and have stumbled upon a strange problem. It is asking me to implement PrimeQ into ...
52 views

### problem solving a simple integral equation

I'm looking for a function q(x) so that integral( q(t) , t , x, x+2*pi/3) == a*sin(x)+b Could anyone help me on this one? Thx in advance
119 views

### How can I make my MM code more compact and readable? Can I put functions in different notebooks?

I'm doing some coding in MM9, but my program is getting quite large. It's mostly a bunch of functions defined at the beginning of it, but it's getting to the point where I have to scroll for a few ...
112 views

### How can I use a For loop in a recursive function?

I am creating a simple radix2 FFT algorithm (based on Cooley-Turkey) by using a recursive function to obtain the fft. The function is supposed to work on a list (assuming the length is a power of ...
88 views

### Limit as n -> ∞ for RSolve with Multivariate Recurrence Relation

I'm trying to solve the following when n -> ∞: ...
136 views

### Automatically highlight certain cells

I am looking for a method to highlight certain cells in a table/Grid based on meeting some user defined conditions. As an example: ...
153 views

### How to efficiently distinguish the rewired edges in WattsStrogatzGraphDistribution?

The WattsStrogatzGraphDistribution function is a way to construct random graphs based on Watts and Strogatz small world model. The ...
70 views

### Unintentional function memoisation via Dynamic

I needed to display edge labels of a graph in a way that allows the edge labels to be moved. ...
133 views

### Easy NMinimize does not converge

I try to minimize the following for a>0: f[a_] := Gamma[3]*a^(-3)*(Integrate[Exp[-u]*(u - a)*1/u, {u, a, Infinity}])^(-1) I put in ...
68 views

### How to save all data in all variables in context different than “global”?

I have seen questions on saving data on "global" context. Now if I set my notebook's evaluation context "unique to this notebook". the global context doesn't work quite well. Any idea what should i do ...
127 views

### Initialize table in a Module but Break if criteria not met

I am initializing a table inside a function as follows: f[a1_, a2_, a3_] := Module[{RM = Table[a1+a2+a3+i1, {i1, 1, 10}]}, Plus@@RM] I am calling the function ...
71 views

### Summing a trig series

I am trying to sum the following expression: (Cos[(2 π m)/N]^2 Cos[(2 π n)/ N])/(2 (Cos[(2 m π)/N] - Cos[(2 n π)/N])) from ...
46 views

### expression contained across multiple cells

Is it possible to span one expression across multiple cells? E.g. long if statement or function evaluation. I looked in documentation and searched forum/google and could not find.
312 views

### Resume/continue interrupted evaluation

I interrupted an evaluation to quickly do something else. How do I resume the interrupted evaluation? I cannot open the "Interrupt evaluation" window, as it is disabled. There is no "Resume" button to ...
453 views

### Randomly selecting and reinserting a subset of elements in a list

This question is similar to my other question: How do I randomly select 'k' positions in a list and shuffle their respective elements without effecting the other elements? Imagine first a ...
98 views

### How do I constrain movement for lists of Locators using 2nd argument of Dynamic?

I need to display edge labels of a graph in a way that allows the edge labels to be moved. Locator seems the simplest and most obvious function to use. My ...
95 views

### Open a pre-existing CDF file from a stand-alone CDF file

This is related to my previous question here A series of my questions are related to an important problem: It is important to be able to CDF-publish a document, and be able to open a separate ...
103 views

### Equation in implicit form

This is simple example: v = {1.48622576, 1.53444276, 1.42299438} v/(v + 1) Out[1]:= {0.597784, 0.605436, 0.587288} In the above case expression v/(v + 1) is ...
45 views

### How to set the values into some variables from different lists [closed]

I have a list of Values and a list of variables. I want to set the Values into Variables. Assume the following code: ...