0
votes
0answers
5 views

\! in string literal

Given this input FullForm[ToString[TraditionalForm[x]]] Mathematica outputs "\!\(TraditionalForm\`x\)" It seems like ...
5
votes
4answers
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}
0
votes
2answers
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 ...
0
votes
1answer
54 views

3D plot of concave data set

I have the following data set ...
24
votes
2answers
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 ...
10
votes
4answers
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 ...
1
vote
1answer
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 ...
0
votes
1answer
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. ...
6
votes
1answer
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 ...
1
vote
1answer
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 ...
1
vote
0answers
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 ...
6
votes
4answers
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 ...
0
votes
2answers
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 ...
2
votes
1answer
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 ...
1
vote
3answers
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. ...
326
votes
12answers
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 ...
21
votes
1answer
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 ...
0
votes
2answers
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: ...
0
votes
0answers
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 ...
1
vote
1answer
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 ...
0
votes
0answers
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, ...
1
vote
1answer
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 ...
10
votes
2answers
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, ...
0
votes
1answer
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 ...
0
votes
1answer
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 ...
3
votes
2answers
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] ...
0
votes
3answers
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: ...
5
votes
1answer
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 ...
0
votes
0answers
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 ...
0
votes
1answer
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 ...
1
vote
1answer
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 ...
-1
votes
0answers
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 ...
3
votes
1answer
34 views

Adding Assumptions changes the result of Integrate

When I try to calculate the following integral: ...
0
votes
0answers
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: ...
0
votes
0answers
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. ...
1
vote
0answers
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 ...
11
votes
2answers
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 ...
4
votes
3answers
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 ...
12
votes
2answers
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. ...
6
votes
3answers
120 views

Does RegularExpression support “(?R)”?

Mathematica's RegularExpression is based on Perl's PCRE library, which supports recursive regular expressions using (?R) (or, ...
4
votes
2answers
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 ...
1
vote
0answers
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: ...
2
votes
2answers
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 ...
6
votes
1answer
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 ...
0
votes
1answer
32 views
1
vote
2answers
35 views

Evaluate list of functions at a certain point

I have a list of functions (actually they are derivatives) of the type: {D[g[x,y],x],D[g[x,y],y]} I would like to evaluate all of these functions at a point, ...
1
vote
1answer
149 views

Find maxima and minima of data like {time,value}

I have a list of time and values of the charge and discharge of a capacitor, and i want to separate in two list of {time,value of charge} , {time, value of discharge} I know there is a lot of the ...

15 30 50 per page