# All Questions

184 views

### How to collect expressions from cells created by Print?

I have a notebook where evaluation of a certain cell produced hundreds of adjacent output cells using Print. I need to create a list containing all expressions from ...
463 views

### How to draw grid lines on top of a plot?

I want to use ArrayPlot instead of a DensityPlot because it seems to be faster (more here) I still want axes ticks to have real ...
233 views

Sometimes you need to check for the type of an expression. You use Head[data] to get answers. Some data: ...
218 views

### FindInstance returns Indeterminate in version 9, but not in 8

Here is a trivial system of equations in three unknowns for which FindInstance obtains a solution: ...
384 views

...
518 views

### How do I “start a reference system”?

When I attempt to insert a citation or specify a database to use as a bibliography, I get a message that I need to "start" the "reference system" "manually": I have no idea what a references system ...
754 views

### How do I find the degree of a multivariable polynomial automatically?

I have a very simple question which appears not to have already been answered on this forum. Is there built-in functionality that returns the degree of a multivariable polynomial? For example if the ...
267 views

### Package found with Needs, but not with ParallelNeeds

I want to use a self-written package in a parallel computation. However while Needs["mypackage`"] works without problems, ...
362 views

### Saving a notebook as a $\LaTeX$ file, with syntax highlighting preserved

How can I save a notebook as a $\LaTeX$ file, while preserving the syntax highlighting (such as input/output boxes)?
479 views

### Space-efficient null space of sparse array

I have a roughly 100,000 × 3,000 matrix (as a SparseArray) that I'd like to find the kernel (null space) of. It has about 500,000 nonzero entries, all -1 or 1. ...
278 views

I am preparing some data for dissemination. I have a series of plots that look like so, using ListLinePlot: The background shading is just being added using ...
651 views

### Why is ListDensityPlot unable to plot datasets with extreme ranges

Consider the following dataset: data = Flatten[ Table[{x 10^-9, y 10^-9, x^2 + y^2},{x, -100, 100, 10}, {y, -100,100, 10}] , 1]; If I try to ...
499 views

### How to mark an image?

How can I place a mark, like a cross-hair (to suggest "X marks the spot") and a text label associated with it, at a particular position on an image (mine in particular is ...
258 views

### Adjusting placement of control objects in a row within a panel

My minimal example ...
326 views

### Boosting the performance of expensive NIntegrate by feeding in a cheap approximation of the integrand

I need to integrate an expensive likelihood L[x] over its n-dimensional domain. I know that L[x] is decently approximated by a ...
398 views

### Plot on command within DynamicModule?

Suppose I have a DynamicModule with all sorts of controls to set some parameters for a graphics object. ...
341 views

### Does AbsoluteTiming slow the evaluation time?

I've started using AbsoluteTiming to discriminate between similar function constructs, but I sometimes feel like it takes substantially more time to evaluate a ...
340 views

### How do I get Mathematica to return a function call unevaluated?

How do I get Mathematica to return a function call (conditionally) unevaluated? I expect this may use the slightly-mysterious Hold function. As a toy example, ...
244 views

### Efficient way of identifying the indices of first occurrences

It seems to me like identifying the first occurrence of unique elements should take about the same amount of time as it takes to delete duplicates. My data sets are much larger than this (...
193 views

### Returning multiple results from a LibraryLink function

What is the best way to return multiple inhomogeneous results from a LibraryLink function? Imagine that the result of a single computation is several tensors of different dimensions and several ...
259 views

### Why does Mathematica fail to series expand this simple expression?

I wanted to expand the function $(x+2)^{x+2}$ around $x = -1$, that is, using Series[(x + 2)^(x + 2), {x, -1, 2}] and Mathematica returns the same expression. ...
2k views

### Why does Mathematica struggle with solving this equation?

Consider the evaluation of the following expression In[20]:= Reduce[ 1000 * 1.0609^t == 1500, t] ...
2k views

### Plot columns of table if some condition is fulfilled

I have a table with data, for example MT = {{1, 80.3, 1, 4, 68}, {2, 80.5, 1, 5.5, 102}, {3, 80.0, 0, 4.2, 78}, {4, 80.4, 0, 3, 17}, {5, 80.2, 1, 5, 180}}; ...
805 views

### Derivatives (divergence, gradient, curl) of interpolated 3D data

How can I calculate a vector derivative (i.e. divergence, gradient, curl) of interpolated data? For sample data, you can use: ...
493 views

### Visualize cluster distances in DendrogramPlot

I want to perform a cluster analysis using the HierarchicalClustering package. Is there a way to display the inter-cluster distances in a dendrogram plot? An ...
193 views

### Unexpected behavior of Compile, Return and ;

Could somebody explain why test = Compile[{{x}}, Return[x]; ]; test[0.] returns ...
384 views

### Animation: presenting events that persist in time

I have a list of events that occurred on specific moments in time. In the example below, the three events occurred at 23:09, 23:13 and 23:17. I was able to build an animation that flows from time ...
1k views

### CUDA and GPU hardware and compatibility questions?

We have iMac desktops and have just begun to parallelize computations across them see: Wolfram Light Weight Grid and parallel computing. This still does not look like it will give us the performance ...
1k views

### 2D Gaussian distribution of squares coordinates

I would like to imitate the structure of this great painting from Ellsworth Kelly in Mathematica. Yet with all the colored squares in Black and the beige one in white. Below is what I have wrote to ...
1k views

### Fastest square number test

What is the fastest possible square number test in Mathematica 7, both for machine size and big integers? I presume in version 8 the fastest will be a dedicated C LibraryLink function.
254 views

### Create a new infix operator

It is well known that the infix operator @@ is used as a short form of Apply. For example, both ...
365 views

### How to solve a stiff nonlinear second-order ode?

I want to solve a nonlinear second order ODE as an initial value problem (IVP). Unfortunately, for certain values of first derivative at starting point I get a stiff-problem. I tried to overtake this ...
322 views

### Finding a point from a set of contours such that it is nearest to a given point

I have several contour lines and one point. How can I find a point in one of those contour lines which is nearest to the given point? ...
119 views

### Named string patterns in Alternatives, why does it depend on order?

When using the same name for part of patterns inside Alternatives how come it behaves differently for strings than in normal patterns? ...
348 views

Running InstallR["RHomeLocation" -> "C:\\Program Files\\R\\R-3.0.1"] results in a popup box titled "Version Mismatch" saying Error: R.DLL version does ...
227 views

### substitution rules excluding subscripted variables

Suppose I have an expression containing p,Subscript[p,1],Subscript[p,2],etc. I want to ...
289 views

### How can I remove matching sublists from my list?

I want to use DeleteCases (or any appropriate function) to remove elements of a list, which in turn are lists of fixed size. The rule I wish to apply is that any ...
245 views

### PlotMarkers doesn't inherit PlotStyle when first argument to Graphics isn't a list

Could somebody explain, why Circle does not inherit the PlotStyle of the plot when used as ...
363 views

### How to improve these WASD + mouse look 3D controls?

Insipred by this question and the corresponding answer I've written a code for full-screen exploration of 3D scenes using standard WASD and mouse look controls. Here it is. ...
142 views

### Algorithm used by IsomorphicGraphQ

I'd like to know which algorithm is used to test if two graphs are isomorphic?
365 views

### Why does Hash return different values in Version 7?

This function does not work correctly for me. The generated Gravatars do not match the ones actually produced by using the corresponding address. The problem was traced to differing output from the ...
738 views

### Coloring each face of a Cuboid with a different color

Is there a way to color each face of a Cuboid with a different color? I looked in the help but couldn't find anything. I found this Coloring the faces of a 3D ...
235 views

### How do I determine astronomical transit times?

Mathematica, through the "legacy" Scientific Astronomer package, used to have the ability to easily determine accurate transit times of astronomical objects simply, with ...
267 views

### How can I highlight one function in the Plot of a list?

I've got a Plot of a list of functions from this previous question of mine. ...
146 views

My code: ...
3k views

### Expressing a decimal as a fraction in lowest terms

How can I express a decimal such as 0.1845095405274387 as a fraction in its lowest terms?
639 views

### CUDALink not working on Mac OS X

On my MacBook Pro, I have a CUDA enabled video card, yet Mathematica does not seem to recognize this. For example, following the CUDALink Setup, I get ...
399 views

### Restrict Locator to a certain graphic inside Manipulate

I would like to restrict the Locator inside Manipulate to a certain graphic. For example if I display two graphs, I would like to be able to click on the right one and use this information in other ...