All Questions

10
votes
4answers
1k views

How do I plot Thomae's function in Mathematica?

I wanted to plot this function $$f(x) =\begin{cases} 1 & \text{if } x= 0 \\ \tfrac1{q} & \text{if } x = \tfrac{p}{q}\\ 0 & \text{if } x \in \mathbb{R}-\mathbb{Q} ...
10
votes
1answer
1k views

How to export transparent raster plots?

Is there an easy way to get transparent plots that work with Save Graphic As using a compatible file format such as GIF or PNG? I tried ...
10
votes
2answers
167 views

Subtle difference in conditional rules placement

I had gotten used to thinking of the placement of a condition in a rule definition as logically immaterial. In my specific example, namely ...
10
votes
4answers
708 views

Efficiently Visualising Very Large Data Sets (without running out of memory)

I have put a few really hard problems in combinatorics up against Mathematica 8. I'd have to say that it works really well, until you want to view the data. If you look at my question Advanced ...
10
votes
1answer
470 views

How to import date (YYYY-MM-DD) data from a file?

I have a file with data in form {date, value}: 2010-05-19 17 2010-05-20 20 ...
9
votes
1answer
121 views

Tracking Initialization

How to track Initialization step by step? Any tricky solution is ok. One condition, x should be ...
9
votes
2answers
164 views

Extracting values with multiple keys

I want to extract sorted data from a huge database based upon two (or more) keys in a very timely manner. Here is a reproducible toy example for two keys only: ...
9
votes
2answers
1k views

Why is this semicolon in red?

I have a piece of code that works well, but when I put a semicolon after a plotting statement, the semicolon appears in red. What's the error?
9
votes
1answer
350 views

What is the proper way to verify that two expressions are equivalent?

First of all, it appears to me that $$\left|\frac{1}{x} + x^2\right| \Leftrightarrow \frac{|1 + x^3|}{|x|}$$ is true. I don't know why, but my attempt to verify it in Mathematica failed. ...
9
votes
2answers
311 views

Recursive Integral for Volume of $n$-Ball

The volume of an $n$-ball (the $(n+1)$-dimensional analogue of a disk) of radius $r$ can be found by the following integral recurrence: $$V_0(r)=2r$$ ...
9
votes
5answers
358 views

Count consecutive occurrences in a list above a certain value

I am trying to tally and sort the number of consecutive occurrences in a list above a certain value. For instance: ...
9
votes
1answer
126 views

What are the scoping rules for function parameters shadowing System` symbols?

Here are some very contrived code snippets, highly unlikely to appear in real code, but still I am curious why they behave like this: ...
9
votes
3answers
387 views

FindShortestTour for charity (or: How can I optimize meal delivery with FindShortestTour?)

I've been wondering about this for a while - but never got around to asking - until I saw faleichik's incredible answer to Mathematica Minecraft. I did some work at a not-for-profit a little while ...
9
votes
1answer
412 views

FourierSeries for rational function looks wrong

I have the following code: ser[x_] = FourierSeries[(\[Pi]^2 + a)/(3 x^2 + a), x, 10] // N // Chop It gives me some series, which I then try to plot. And ...
9
votes
2answers
629 views

Customize your FrameTicks in a MATLAB way

The figure below is made by MATLAB. However, the scientific form of numbers in FrameTicks that how MATLAB deals with is quite different from that of Mathematica. ...
9
votes
2answers
262 views

Determining whether two $k$-chromatic graphs are isomorphic (respecting vertex coloration)

Consider the case where I have two $k$-chromatic graphs $G_1$ and $G_2$, i.e. two graphs where individual vertices can be colored with one of a set of $k$ total colors, and I would like to determine ...
9
votes
2answers
314 views

Speed up 4D matrix/array generation

I have to fill a 4D array, whose entries are $\mathrm{sinc}\left[j(a-b)^2+j(c-d)^2-\phi\right]$ for a fixed value of $\phi$ (normally -15) and a fixed value of $j$ (normally about 0.00005). The way ...
9
votes
3answers
660 views

Forest plot with Mathematica 9

Does anyone have experience with or a package for the creation of forest plots in Mathematica 9? For instance for subgroup analyses of cox model or meta-analysis (e.g rmeta package in R)?
9
votes
0answers
320 views

Proving (self) similarity with Mathematica - Reccurrence Plots, Similarity Plots etc

I posted this question in math.se but given the sheer tumultuous number of questions that keep appearing on math.se and also given that I am trying to accomplish this in Mathematica, I thought I'd ...
9
votes
1answer
2k views

Using RegionFunction on multiple plots

I realize that the Plot function can plot multiple functions of x at the same time, using { }. I also know that the ...
9
votes
3answers
1k views

Importing HDF5 with compound data

I am looking to Import HDF5 data with compound data. It appears, at least from what I read, that Mathematica 8.0.4 (and previous versions) does not support reading ...
9
votes
1answer
744 views

Changing default window appearance

Since every single time I start Mathematica, my first action is aligning the windows properly (Notebook on the left for $2/3$ of the screen, help on the right for the other $1/3$), I was wondering ...
8
votes
0answers
70 views

DumpsterDoofus's captivating generative art

How can I render these beautiful images that DumpsterDoofus posted?
8
votes
3answers
355 views

Getting a custom bezier curve function to work

In general, $nth$-degree Bezier curve defined as below: $$\vec{C}(u)=\sum_{i=0}^{n} B_{i,n}(u) \vec{P_i} \qquad 0\leq u\leq1$$ $B_{i,n}(u)$ is the classical Bernstein polynomials, ...
8
votes
4answers
302 views

Fast method to select matrix elements based on a vector of positions

There is an operation for which I have long wanted to find a better solution. Let: a be a matrix of dimensions $m\times n$ ...
8
votes
2answers
293 views

Finding all sets of elements with two common elements in a large dataset

I have a very large network of atoms ($\approx 10^6$ atoms) with fixed positions that resemble a cellular structure: I have two files including: fixed locations of each atom set of points which ...
8
votes
1answer
116 views

Head of a MatrixForm expression?

An example in http://www-zeuthen.desy.de/theory/capp2005/Course/hahn/mathematica.pdf amounts to the following ...
8
votes
1answer
131 views

How to understand shared passing of a MTensor in LibraryLink?

According to the documentation, there are four different type of memory managing when passing a MTensor with LibraryLink: Automatic, "Constant", "Manual" and "Shared". The Automatic and "Manual" is ...
8
votes
1answer
447 views

how to simplify large expression with lots of special functions in it (BesselY, Hypergeometric, MeijerG etc…)

I saw this DE in Maple forum. When solving it using Mathematica 9.01, even though the result was correct (both solutions gave the same numerical answer for some random values), Mathematica's answer ...
8
votes
1answer
449 views

How to calculate the $H_2$ and $H_\infty$ norms of TransferFunctionModels or StateSpaceModels?

Lets assume we have a system model: ...
8
votes
3answers
571 views

How to typeset a system of equations

Is it possible to typeset systems of equations in Mathematica, and if so, how can I do it using a big left bracket as one could in LaTeX with \left\{ ... \.? I ...
8
votes
1answer
144 views

After modifying expression, new result doesn't replace old one

After I modify and re-evaluate an expression, the new result doesn't replace the old one. Rather, what happens is that the old result gets pushed down and Mathematica displays the current result at ...
8
votes
5answers
327 views

correct way to map a function on entries down the pages in a 3D matrix?

updated: added another method to the methods I tried below for completion. This is new way of doing it, but most likely not very efficient, did not time it I can only visualize 3D matrices in my ...
8
votes
1answer
258 views

How to compile Heike's winding number function?

Heike gave the following function for winding number: ...
8
votes
3answers
535 views

Expression of uncertainty in measurement.

I have a problem with writing a Mathematica function. I have been requested to show the results of my experiments with the measurement uncertainty (mu) like below: ...
8
votes
1answer
497 views

Why doesn't FullSimplify get rid of the common factor in this expression?

FullSimplify does not get rid of the z factor in the following expression: ...
8
votes
5answers
531 views

How to save Manipulate bookmarks permanently?

I would like to save current Manipulate parameter values to load them again later. Bookmarks (previously discussed here and here) work fine until the cell is ...
8
votes
2answers
327 views

Tailoring RegionPlot3D with PlotPoints?

This seemingly tame solid gives Mathematica (v9) a bit of a workout if you want to generate a good picture: ...
8
votes
3answers
157 views

How can I use the overhang argument to Partition to avoid using PadLeft and PadRight here?

Say I have a list of values v = {v1, v2, v3, ... }. I need to partition these values to perform operations with a sliding window (think ...
8
votes
1answer
402 views

Wrapping a rectangle to form a cylinder

I'd like to make an animation showing how we wrap a rectangle to form a cylinder (by joining a pair of parallel sides). Here's my first pass: ...
8
votes
2answers
479 views

Extracting vertex coordinates from an automatically laid out graph

Given a Graph with an automatically computed layout (i.e. not explicitly given VertexCoordinates, but using a ...
8
votes
2answers
283 views

Trouble getting FindInstance to return multiple results for certain constraints

I'm having a hard time getting FindInstance to return multiple results. Consider this simple example: ...
8
votes
1answer
360 views

Way to find color at a point in a Graphics?

I need to figure out a way to find out the RGB color value at a certain coordinate in a Graphics object. The Graphics object I am dealing with is continually Dynamically updated, so it is made of ...
8
votes
2answers
282 views

What is modifying an init.m that changes menu Palettes order?

When I installed the mathStatica application, it seems to have made some kind of change deep in my Mathematica 8.0.4 system files. That change causes the mathStatica palette to appear out of ...
8
votes
2answers
187 views

Checking from a preemptive evaluation whether a main evaluation is ongoing

How can I programmatically check from a preemptive evaluation whether a main evaluation is currently ongoing? I need a function mainEvaluationOngoingQ[] so that ...
7
votes
5answers
343 views

Splitting strings at lower case characters and numbers

I'm trying to split the strings of chemicals into their elements and numbers. See this example "Fe3O4" will be split into ...
7
votes
4answers
276 views

Join two datasets on keys

I want to be able to join two datasets by keys, pretty much like I'd do in SQL. I thought the JoinAcross function might do it, but it doesn't operate the way I thought. The example in the ...
7
votes
2answers
186 views

How can I prevent a compiled function from using uncompiled evaluation?

I write a code that creates a compiled function, and then call that function over and over to generate a list. I run this code on a remote server via a batch job, and will run several instances of ...
7
votes
2answers
222 views

Using least independent rectangle area to separate every point

Description I want to add vertical line and horizonal lines between data to make every point have an independent rectangle area. In addtion, every independent rectangle has a number ...
7
votes
4answers
447 views

Generating an Ulam spiral

An Ulam Spiral is quite an interesting construction, revealing unexpected features in the distribution of primes. Here is a related topic with one answer by Pinguin Dirk, who has provided one ...

15 30 50 per page