# All Questions

7k views

### ShowLegend values

How do I get ShowLegend to put the max and min values that a plot produces. for example, when using ListDensityPlot, with ...
1k views

I have been working on picking expressions apart using Head and Part and encountered a little mystery. Consider the canonical ...
523 views

### Why doesn't PatternTest work with Composition?

While playing around with the solutions to this question, I've found some very strange behaviour: ...
2k views

### How do I perform string matching and replacements?

What are, and how do I use Mathematica's string matching and replacement tools?
7k views

### Minimal effort method for integrating C++ functions into Mathematica

As of Mathematica 8, what is the minimal effort way to integrate an existing C++ function into Mathematica? I think we have these: MathLink (it was quite long ago I used it last time) communication ...
3k views

### How to efficiently find positions of duplicates?

Is there an efficient way to find the positions of the duplicates in a list? I would like the positions grouped according to duplicated elements. For instance, given ...
10k views

### How can I use Mathematica's graph functions to cheat at Boggle?

Boggle is a word game played with 16 dice and a 4x4 tray. This question is inspired by a Stack Overflow question about Boggle that I decided to solve using Mathematica. In addition to Mathematica, I ...
1k views

### Transferring a large amount of data in parallel calculations

This question is inspired by one of @whuber's answers Consider the following code: ...
7k views

10k views

### How to calculate scalar curvature Ricci tensor and Christoffel symbols in Mathematica?

I am seeking a convenient and effective way to calculate such geometric quantities. I've used packages like TensoriaCalc, but they don't work at all time. ...
3k views

### An efficient circular arc primitive for Graphics3D

As many people have noted, the 2D graphics primitive Circle doesn't work in a Graphics3D environment (even in v10.0-v10.2, where ...
2k views

### Removing elements from a list which appear in another list

There are two lists {a, b, c, a, d, a, e} and {a, c, a}. I need to remove those elements from the first list which appears in a second list, to get {b, d, a, e}
3k views

### Generating evenly spaced points on a curve

In the KnotData package a simple command such as points = Table[KnotData[{3, 1}, "SpaceCurve"][t], {t, 0, 2 Pi, 0.1}]; will ...
3k views

### Point Renderings Slightly Off in Mathematica

The Mathematica code ...
5k views

### Extract current viewing parameters from a 3D view?

Is there a way to find out the current viewing parameters of a 3D view? What often happens is that I create a view, for example: ...
11k views

### Estimate error on slope of linear regression given data with associated uncertainty

Given a set of data, is it possible to create a linear regression which has a slope error that takes into account the uncertainty of the data? This is for a high school class, and so the normal ...
4k views

### Efficient way to generate random points with a predefined lower bound on their pairwise Euclidean distance

Using Mathematica what is an efficient way to generate a list of $n$ random two dimensional points $\{x_i,y_i\}$ where $i=1,...,n$ so that no two points $p_1$ and $p_2$ in the list has an Euclidean ...
3k views

### Extruding along a path

I'm trying to render a 3D image of a path by extruding a circular cross-section along the path, creating a "snake-like" path. Here is an image I found to illustrate: I can't seem to figure out if ...
5k views

### Fastest way to calculate matrix of pairwise distances

It is a very common problem that given a distance function $d(p_1,p_2)$ and a set of points pts, we need to construct a matrix ...
2k views

### How to splice together several instances of InterpolatingFunction?

I have a set of InterpolatingFunction returned by NDSolve which are valid over different (but overall continuous) domains. How ...
2k views

### How to load a package without naming conflicts?

This question applies to any package, but I encountered this problem while working with graphs. There are symbols in the Combinatorica package (such as ...
975 views

### How do you set attributes on SubValues?

SubValues, as discussed in a previous question, are declared as follows ...
3k views

### Having the derivative be an operator

How do I create an operator which acts like a derivative to everything to the right of it: for example: $\left( \partial_x + \partial_y + z \right ) x \psi$ How do I make that evaluate to: \$x ...
5k views

### Find all roots of an interpolating function (solution to a differential equation)

I'm trying to find all the roots of the solution to a differential equation. Using NSolve or Reduce I don't get the roots, so I'm using an iterative method which I found in physicsforums.com. This ...
1k views

### Common subexpression from two expressions

I am working with some unpleasantly tedious polynomials, which need to be manipulated in various ways (integrate with respect to some variable, differentiate with respect to another). Since these ...
2k views

### How to make traditional output for derivatives

Hello again after some pause. i have a problem how to present partial derivatives in traditional form, not as Mathematica gave it to me in its notation. So I want to present this ...
3k views

### extract values from replacement list

Solve returns a list of replacement rules In: Solve[x + y == 3 && x - y == 6, {x, y}] Out: {{x -> 9/2, y -> -(3/2)}} I am only interested in the ...
2k views

### Problem with ContourPlot

I tried these ...
169k views

### xkcd-style graphs

I received an email to which I wanted to respond with a xkcd-style graph, but I couldn't manage it. Everything I drew looked perfect, and I don't have enough command over ...
3k views

### Once more on object orientation in Mathematica: does it have to be so hard?

Recently I came across a set of problems which would be solved most easily within an object-oriented approach. I first attempted to solve them by other means, but found the complexity of the code ...
7k views

### How to make a 3D globe?

There are many ways to create a 3D Earth that is rotatable (see here, here, related here), but most of them have some drawbacks. These issues mainly stem from either ...
2k views

### The clearest way to represent Mathematica's evaluation sequence

WReach has presented here a nice way to represent the Mathematica's evaluation sequence using OpenerView. It is much more clear way to go than using the standard ...
3k views

### Saving Mathematica kernel state?

If I save a notebook, I only save what I see. That is, if I close Mathematica and reopen the notebook later, all previous calculations are lost, except for those things I've output. Now I know that ...