# All Questions

5 views

### \! in string literal

Given this input FullForm[ToString[TraditionalForm[x]]] Mathematica outputs "\!$$TraditionalForm\x$$" It seems like ...
27 views

### Input a square matrix and return a list of the matrix entries read by antidiagonals

I have a square matrix: {{1,2,3},{4,5,6},{7,8,9}} and I want to get a list: {1,2,4,3,5,7}
16 views

### Maximum likelihood estimation based on frequency table

I have a frequency table of grades, I'm trying to estimate the distribution as a truncated normal distribution (a grade below 65 is a failing grade and doesn't count). Since I don't have the actual ...
54 views

### 3D plot of concave data set

I have the following data set ...
727 views

### Is there a name for #1@#2&?

Why does the pure function # @ #2 & have no name? I'm asking because sometimes I find inelegant to write expressions like ...
407 views

### Exporting data extensions in fits file

Context In Astronomy the de facto standard for images and data is FITS. I would like to export heterogenous data sets into a single fits file. Attempt I am ...
24 views

### Table of references

I have a list of variables (say a, b, c, d, e) that I want to assign in a single command. {a,b,c,d,e} = {1,2,3,4,5} would ...
21 views

### Vertex styling in CommunityGraphPlot

Is there a way to change the colours of nodes within one community? Mathematica assigns vertex colours automatically to each community. However, I'd rather like to use my own colour set. ...
150 views

### Speed up MinimalPolynomial

My Mathematica code runs slowly MinimalPolynomial[Sqrt[2] + Sqrt[3]+ Sqrt[5]+ Sqrt[7]+ Sqrt[11]+ Sqrt[13], x] runs slowly, but the Maple version ...
32 views

### Code reuse between files in the same directory

At the moment, I am producing various complicated interactive plots. They all share a common "code base", with modifications on top of it. I would like to refactor my code so that the various files ...
8 views

### Design problem with an an InterpolatingFunction-like object: bad performance over a remote kernel

I these last times, I found myself using often the following approach. Given some data, I make some preliminary, common, computations and I store these results in an ...
121 views

### Define Function with Sum over a list

I want to define a function that would symbolically look like $$t(s,\underline{a})=\pi s + \sum_{n=1}^{n_{max}}a_n\sin(n \pi s)$$ (something like a finite Fourier series). Here $s\in [0,1]$ and ...
35 views

### NIntegrate and Integrate of a Spherical Bessel function

I am trying to integrate over a spherical bessel function. I have used both the Integrate and NIntegrate functions in Mathematica but the values given by each do not match. Any reason why this ...
28 views

### Writing a procedure that invokes Manipulate[]

I would like to write a procedure with the signature: Foo[vars, params] which produces a Manipulate object. The procedure ...
33 views

### Form a matrix to have inequality elements

It looks like a silly question, but I could not find any answers online. Your help is greatly appreciated! Say I have two lists now. ...
63k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
315 views

### Visual representation of a Ranking over time (image provided)

[Disclaimer: I initially posted this question on stackOverflow 2 months ago and think it might be better suited for this forum (link to original question)] The graph below shows a ranking of ...
32 views

### How to continuous apply a function to an argument? [duplicate]

In order to calculate x = sqrt(1 + x) for a given number x, 40 times, I tried this: ...
11 views

### LayeredGraphPlot Vertex Spacing

For anyone who has used LayeredGraphPlot, you have probably seen that the vertex spacing is consistent throughout, that vertices have the same minimum unit of ...
72 views

### How to make hollow Graphics3D?

I keep seeing a notebook to use of Mathematica as a 3D Printing tool (e.g.: this link). In the notebook on slide 8/11, we find these pictures: I'd like to design it as such that, but I don't ...
28 views

### “cannot be used as function” error. Mathematica 9

I am trying to use Mathematica do solve a system of differential equations through a series. For the time being, I want the solution to be in terms of a quadratic. So here is an example, ...
79 views

### Changing default behavior of Series to give slightly different SeriesData

I am working with complicated expressions expr that contains the symbolic function f[x] which I know to have a pole at ...
331 views

### Floating point operations — division vs multiplication; how do they affect accuracy?

Given two functions: f[x_] := x ((x + 1)^(1/2) - x^(1/2)) g[x_] := x/((x + 1)^(1/2) + x^(1/2)) Which one is more accurate? Side note: If you could explain why, ...
33 views

### Simplifying square root expressions

I have read lots of questions on square root simplification on MMA, but I haven't really seen my problem posted (or understood a clear way to deal with this issue). I am simplifying some expressions ...
36 views

### How to subset datasets in Mathematica 10

I'm sorry if this is obvious but I can't find a way to select only a certain amount of columns of a dataset (or delete a certain amount of columns from a dataset) using the key of each column. I ...
22 views

### ReadLine[file] after reopening a closed stream doesn't read at the beginning of file?

Take a text file from your system: file = OpenRead["path/to/your/file"] ReadLine[file] Close[file] Here ReadLine[file] ...
39 views

### Trouble using Manipulate and NDsolve for coupled ODE's

I'm aware that there are a few threads on the topic of solving coupled ODEs using NSolve and Manipulate. Based on those, I wrote the following code, solving my system of equations: ...
61 views

### Why does Mathematica remember print settings?

Mathematica has a strange behavior with respect to printing and saving to PDF. It remembers the print settings, such as page range and number of copies along with the file. So if I print 50 copies ...
20 views

### Cases Except - Selective Exclusion

Please help me use Cases,Except on list data. I just want to remove all primes, or equivocally to see only the values in the list produced that aren't prime. the prime factorization of those values ...
31 views

### Subscript und Superscript in FrameLabel and Export

I'm creating plots that I want to export as png. Which works, but when I add sub- or superscript into the FrameLables or get 10^x in LogPlots the sub- or superscript letters in the exported png will ...
98 views

### How to avoid NDSolve::ndsz problem (singularity problem)

I have the next model ...
36 views

### Is this caused by meomory usage ? (Something odd/hard to describe)

I really can't make a "smaller" example, but the files are here, for the data and for the notebook. It will cost a LOT of memory, up to 30G of RAM (maybe more). Here is the problem, (from a Linux ...
52 views

### Plotting RandomVariates

I have simulated 10000 random variates from a copula distribution. I would like to plot them on a graph. How would I do this for a) If the random vector is 2 dimensional (so one on x-axis and one on ...
34 views

### Adding Assumptions changes the result of Integrate

When I try to calculate the following integral: ...
18 views

### Does Mathematica support Laguerre Polynomials of Matrix Argument?

I am wondering whether Mathematica can also compute the Laguerre polynomials of matrix argument as the appear in multivariate statistics? For example, they appear in this paper here: ...
20 views

### Porting Module from one version of Mathematica and platform to another [on hold]

I recently wrote a Module in Mathematica v9.0.1 on OS X, and tried to run it on Mathematica v10 for RPi Raspbian Linux. Sorry if this belongs in the RPi SE. ...
24 views

### Strange appearance artefact in ActionMenu

I've noticed a strange thing with ActionMenu which can also be seen in the documentation for V9 and V10 on OS X. It seems that when an ...
270 views

### I define a variable as local to a module BUT then the module uses its global value! Why?

I have a question about modules and local variables. Here's my example: h = 5; Module[{a, h}, a[h_]= h^2; a[4]] (*Out[2] = 25*) I expected the module to ...
143 views

### Manipulate: How to create custom reset Button automatically?

I have a complex Manipulate with more than 10 controls. Each one has its own default value. I'd like to add a custom button in the control area to reset all ...
768 views

### How to build a bvh player in Mathematica?

How to build a bvh player that can be used to visualize human motions in Mathematica? Any idea or sample code would be appreciated. ...
26 views

### Series expand root of quartic polynomial containing many real parameters and FullSimplify return Indeterminate`

Using Mathematica I can get the Eigenvalues of the following matrix: ...
120 views

### Does RegularExpression support “(?R)”?

Mathematica's RegularExpression is based on Perl's PCRE library, which supports recursive regular expressions using (?R) (or, ...
85 views

### Deleting or replacing inner elements depending on higher level elements

Consider a data structure like: ...
81 views

### DeleteMissing issues [duplicate]

Has anyone had problems with the DeleteMissing function in Mathematica 10.0.2? I find that it rarely works. Most of the time it returns a list which still contains ...
39 views

### System of differential equations

I have to solve the following system of two differential equations with certain parameters inside which I just put them together for simplicity and called them t: ...
19 views

### How to change the default printing options using commmand?

I am looking for something like this: SetOptions[EvaluationNotebook[], "PaperSize" -> "A3"] The options are listed, but where do I find the arguments? Say ...
91 views

### Limit characters/digits entered into InputField

When using InputField, whether setting the input type as a Number or String, is there a way ...
32 views

Observe that ...