# All Questions

995 views

### Eliminate doesn't work in Mathematica

Hello Mathematica users, I have problems trying to eliminate variable $Q(x,y)$ froma PDE, but Mathematica output is just True. The problem is that I already found ...
372 views

### Using Periodogram to investigate the seasonality of the data

After asking how to get rid of the seasonality of this set of data, I'd like to ask how to investigate the seasonality in data using Mathematica. Which tool would you use to study seasonality? I.e. ...
914 views

### Dynamically choosing which Manipulate controls to use

I have some stuff I would like to manipulate, using two different kinds of control, one at a time, using another variable as a switch. These controls are similar in principle to ...
122 views

### How to copy Coordinates of “Get Coordinates” in Figure?

I am trying to reproduce the answer here about Recovering data points from an image. I click the figure and press "Get Coordinates". I would like to copy the four coordinates by CTRL-C and then paste ...
378 views

### Fastest way to concatenate many text files in a given directory

I have about 1 million .txt text files in a directory which I would like to all concatenate in one single text file (separated by a newline character "\n"). Because of the number of files and their ...
5k views

### Forcing FindRoot to return only real solutions

FindRoot documentation reports that if the equation and the initial point are reals, the solutions are searched in the real domain. However, in the following case I ...
733 views

### Derivative of an expression containing a symbolic sum [duplicate]

Is there a general pattern for working with symbolic sums in Mathematica? For example here's a derivative I want to compute: ...
3k views

### How do I plot x[t] vs. x'[t] (where x[t] and x'[t] are solutions to NDSolve)?

I have a differential equation which I solved using NDSolve. I can easily plot x[t] vs. t, x'[t] vs. t, but.... how do I plot x[t] vs. x'[t]? I tried using the Evaluate function to simplify things, ...
310 views

### Performance of compiled functions (Project Euler No14)

I was playing around with the project euler problem 14. The solution I came up with is listed below as cf1. The solution works fine but I get the compiler warning: ...
270 views

### Basins of attraction of equilibrium points

The Henon-Heiles potential is the following V = 1/2*(x^2 + y^2) - y*(1/3*y^2 - x^2); which has four equilibrium points ...
74 views

### Set form of all output to InputForm

I try to interact with mathematica using MathLink for symbolic computations. By default it returns strings such as 2\012-1 + E\012-------\012 3\012 E if the ...
772 views

### Version 10 cannot print properly?

Bug introduced in 10.0 and persisting through 10.4 or later I have two problems with printing in version 10. First, I can't print correctly with a setting of printing scale For example, I have ...
607 views

### GroupBy twice gives different results

Bug introduced in 7.0 or earlier and persisting through 10.4 or later It took me quite a lot of time to finally trace down to this strange output. I really don't know why. First, I create a list ...
600 views

### When exporting an (animated) GIF, is it possible to specify the size of the color palette?

I've exported an animation to animated GIF, which generated a 15mb file. I've been asked if I could regenerate the file, limiting it to only 16 colors, but I can't find any documentation on how I ...
1k views

### Highlighting individual countries on a world map

Consider the following list of countries which I would like to highlight on a world map: ...
218 views

### How to avoid the wiggly text on Ticks and Labels when rotating 3D objects

Motivation I'm trying to do a nice animation of the rotation of a ParametricPlot3D . My problem is that the Ticks numbers and <...
1k views

### How can I randomly generate a unique, unused symbol?

In a previous question on collecting terms for a multivariable polynomial, I answered with a solution that required a unused symbol to be used for a temporary substitution and back substitution. It ...
2k views

### Effective matrix power like algorithm

First example Suppose you want to calculate the 6th power of some matrix $A$. The brute force attempt of doing this is considering $$(((AA)A)A)A)A$$ which requires a total of 5 matrix multiplications....
651 views

### Add a vector to a list of vectors

What is the syntax to add v1 to each vector in v2? I know it has to be simple, but I really have searched and not found it. <...
423 views

### Count number of sublists with a total not greater than a given max

Suppose I have a list of positive integers: data={1, 1, 2, 3, 3, 3, 5, 5, 5, 7, 7, 8, 8, 9, 10, 10, 12, 16, 23} I want to count the number of subsets up to ...
410 views

### Messages leak out from Block

Bug introduced in 8.0 or earlier and fixed in 10.1 When assigning message to a symbol localized by Block, I would expect that this message is not accessible ...
149 views

### How to keep the ctrl+shift+k help menu remain in display while typing? [closed]

In Mathematica 9, one can type ctrl+shift+k to display menu which has all the possible signatures/definitions for the function or command in question. One can ...
238 views

### Aggregation queries on lists of associations in 10.3

Bug introduced in 10.3.0 Some aggregation queries applied to a list of associations (or Dataset's with this structure) lock up the front end or crash the kernel ...
2k views

### Measure perimeter of black edge in Mathematica

I have a pattern like the one below. How could I measure the total length of the perimeter of the black/white edge? This would give me a measure of spatial frequency. Any tips would be great! Thanks!
830 views

### How do I generate the upper triangular indices from a list?

I have some list {1,2,3}. How do I generate nested pairs such that I get {{1,2},{1,3},{2,3}}? That is I'd like a way to ...
224 views

### Exp is slower for some number ranges

I get a hit on performance with the Exp function depending on the range of my inputs. for example, with: ...
1k views

### Compact Rational Function Fitting

I have some data from a study that I am trying to fit with a rational function of arbitrary form: $y(x) = \frac{\sum_{i=n}^m A_ix^{i/q}}{\sum_{j=o}^p B_jx^{j/r}}$ where $i$, $j$, $k$, $l$, $m$, $n$, ...
830 views

234 views

### Grid cuts my images

Bug introduced in V9.0 or earlier and persisting through V10.4.0 pic2 = ImageResize[ ImageCrop@Rasterize@Graphics@Disk[], {Automatic, 40}] ...
643 views

### Solve differential equation using a integral form boundary condition

I have a second order differential equation and I want to solve it analytically (DSolve) and numerically (NDSolve) with ...
462 views

### How to enlarge Mathematica's knowledge about certain functions?

I'm often troubled with the following task. I need to carry out symbolical computations involving certain special functions. Let me take as an example Barnes gamma-function. It is included in ...
728 views

### How to run an external program in parallel with a Mathematica package?

Under Mathematica 8 (Linux x84_64) I was able to run an external program in parallel from a Mathematica package. However this procedure breaks down under Mathematica 9. Within my Mathematica package ...
240 views

### Layout a second graph of the same nodes in the same way

I have a number of graphs with the same nodes. I would like to be able to somehow save the layout that results from the spring embedded results of one graph (the first image), and have the other ...
179 views

### func::usage needs to be run twice? [duplicate]

There is an annoying problem that I can't figure out why it's happening. I have defined a usage for a my function tensorA: ...
258 views

This is probably a very simple question, but I couldn't find a duplicate. As everybody knows, {x, y} + v gives {x + v, y + v}. ...
242 views

### Nearest Kronecker Product

Some people (see The ubiquitous Kronecker product by Van Loan) have worked on finding two matrices $\mathbf A$,$\mathbf B$ of specified size whose tensor product $\mathbf A\otimes\mathbf B$ is closest ...
862 views

### Animate point going around a triangle

How can I animate a point moving on a triangle's sides? I can generate a triangle and point, but I have no idea how to define point movement. I'm guessing that I have to use $\sin$ and $\cos$ in ...
2k views

### Creating 3D dice

How to create an image of a 3D die from the 2D images? There is an example in the Documentation Center I tried but it doesn't work.
757 views

### Elegantly split a matrix into positive and negative parts?

I have a matrix $M$ of real components, and I want to split it into two matrices $M^+$ and $M^-$ of the same dimensions as $M$, where $M^+$ contains the positive components of $M$ (the remaining ...