# All Questions

2answers
3k views

### Is there a way to separate variables between multiple notebooks?

I often correct homework by checking the calculations in Mathematica. Sometimes you would like to have two solutions open at once. However often defined symbols such as ...
3answers
8k views

### ListPlot with each point a different color and a legend bar

I would like to generate a ListPlot with the color for each point in the plot corresponding to a particular value (not associated with the position in the plot). I'd then like to add a legend ...
3answers
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 ...
4answers
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 ...
5answers
1k views

### How do you programatically load data into symbols?

I am trying to convert a list of string names into symbols, which will then be used to store data. I have 24 files (where the name of each file is a member of the list mentioned above) that I need to ...
1answer
528 views

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

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

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

What are, and how do I use Mathematica's string matching and replacement tools?
6answers
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 ...
6answers
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 ...
2answers
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 ...
7answers
2k views

### Find continuous sequences inside a list

I have a list which is something like this: {3,4,5,6,7,10,11,12,15,16,17,19,20,21,22,23,24,42,43,44,45,46} What I'd like to to is get the intervals which are in ...
1answer
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: ...
5answers
7k views

4answers
2k views

### Problem with ContourPlot

I tried these ...
2answers
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.4, where ...
4answers
11k 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. ...
8answers
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}
6answers
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 ...
3answers
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: ...
6answers
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 ...
7answers
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 ...
4answers
766 views

### How to make MapAt work with Span?

Span (;;) is very useful, but doesn't work with a lot of functions. Given the following input ...
6answers
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 ...
5answers
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 ...
3answers
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 ...
1answer
988 views

### How do you set attributes on SubValues?

SubValues, as discussed in a previous question, are declared as follows ...
5answers
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 ...
3answers
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 ...
2answers
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 ...
8answers
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 ...
10answers
2k views

### Fibonacci Sequence Generator

I'm trying to write a function in Workbench which will generate a Fibonacci sequence starting with F0 = 0 and F1 = 1. So far I ...
2answers
321 views

### Unexpected behavior of rule matching a pattern

I am a beginner exploring the world of Mathematica. I expected the following code T[6, 5, 4, 1, 2, 3] /. {T[a___, 1, b___] -> Length[List[b]]} should return ...
2answers
2k views

### Error entering equation in DSolve

I entered a command incorrectly as follows: DSolve[{y'[x]=y[x]},y[x],x] I am now experiencing: ...
6answers
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 ...
2answers
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 ...
4answers
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 ...

15 30 50 per page