# All Questions

2answers
152 views

### Permutations: selecting reviewers without conflicts of interest

I would like to automate the process of selecting a number of proposal reviewers that fit a conflict of interest criterion. Let's say I have 5 reviewers and 5 applicants from 5 departments. The ...
0answers
207 views

### Using FindFit to fit nonlinear ODE parameters, subject to a constraint (an inverse problem) [duplicate]

Similar to this post I am finding that constraints tend to make FindFit poor at finding a good fit. However, unlike the previous post, the constraints are required ...
0answers
39 views

### Matching Root[…] objects with patterns, unexpected hidden argument

I needed to write patterns that could distinguish between arbitrary-function and polynomial forms of Root objects, for example, ...
4answers
2k views

### Removing empty sets from lists

If I had a list, say, names= {"Andy", "Bob", "Carly", "Sandy", "Jeff", "Tim", "Tom", "Zach"} and I decide to pick a characteristic only a certain of them have, ...
0answers
62 views

### The “right” way to define a custom Encoding format?

I have implemented an Import|Export format for xz that behaves like gzip and other encoding formats: ...
1answer
186 views

### How do you find the longest sublist within a nested list

Say, I have a list stuff={{eat,tea,now},{how,did,you,say},{the,cat,ate,was,can},{win,din,sin}} I have a nested list and I want to find the list that has the most ...
0answers
104 views

### Is it possible to use Gaussian cgs units in $Mathematica$ computations?

I was trying to do computations in Gaussian cgs units, and of course I failed due to dimensional issues. For instance, $q_1 q_2/r$ cannot be converted to $\mathrm{erg}$ since Gaussian system uses ...
2answers
1k views

### Create simple table with function of column values

I just want to create a simple table: Three input columns, one output column Call the inputs {x,y,z}, each can take values ...
1answer
390 views

### Change font for the whole notebook

Is there any option Mathematica's preferences to change the font for the whole notebook? I know how to change the font of individual cells.
2answers
124 views

### Plot: how to have the y-range automatically scale to min-max on the x-range?

I have a long list of {date,value}. I would like to use DateListPlot to plot only a subrange, from date1 to date2, with the range on the y-axis automatically chosen to be between the min and max ...
3answers
237 views

### How to efficiently find moments of a multinormal distribution?

I have a multinormal distribution with covariance matrix $\sigma$ and zero mean. I want to find moment $$E[x_1^{r_1}x_2^{r_2}\cdots x_n^{r_n}] =\,?$$ Of course, there is a build-in function ...
3answers
371 views

### Differential equation of mass spring system with compliant stoppers

I would like to solve numerically the differential equation for the displacement x[t] of a mass m-spring ...
1answer
681 views

### How to plot a function $\psi(r,\theta,\phi=0)$ in polar coordinates?

I have a function $\psi(r,\theta,\phi=\phi_0)$ with $\phi_0\in \Re$, $r\in[0,R]$ with $R\in \Re$, and $\theta \in [0,\pi]$ (spherical polar coordinates) and I want to plot it in Mathematica. I guess ...
1answer
85 views

### Export to CDF fails

The code below generates the error when I attempt to export to CDF Preview: Coordinate {xde[4.69588928222656], yde[4.69588928222656]} should be a pair of numbers, or a Scaled or Offset form. ...
1answer
114 views

### Text formatting with different wrappers

Formatting text in Mathematica should be a punishment for serious crimes. I've face another frustrating feature, and I don't know how to get rid of it. ...
1answer
165 views

### Mathlink works strangely

I have problem when using mathlink, the source code is quite simple: ...
1answer
169 views

### The third argument of the Root function

Consider the roots of an arbitrary indecomposable polynomial: sol = Solve[x^5 + 2 x + 1 == 0, x] The returned expression is ...
1answer
89 views

### Is there any automatic method for rating function arguments importance?

If I have a function: y = 2a + 5b + c It can be easily seen that b is the most important parameter, next ...
2answers
564 views

### Find parameters of ODEs to fit solution data

Problem How to find the initial conditions x[0],y[0] and the optimal value of parameters ...
1answer
137 views

### Plotting values above a threshold in ListPlot3D

I'm able to plot a 3D plot of a grayscale image using ListPlot3D, where it plots a 3D surface of the image pixel intensity. But I would like not to plot the pixel ...
0answers
125 views

### Defining an operator

Let s be a positive integer and let DifferenceDelta be this function with step = 1. Define ...
0answers
114 views

### NIntegrate doesn't work

I have a function, Dx[s] (defined in a module) which I can plot: Plot[Dx[s], {s, 0, GetLatticeLength[]}] However if I try ...
1answer
78 views

### Stop function evaluating input at time of definition [duplicate]

I would like to create a function that acts on whether the input is even or odd, e.g.: In[644]:= f[a_] = If[EvenQ[a], 2 a, 3 a]; f[2] Out[645]= 6 I've ...
1answer
240 views

### What algorithm and tools should I use to search a data set for the point nearest to a given point?

I have about 1,000,000,000 points, which are the longitudes and latitudes of some places in a city, formatted like this: $(106.1231233,41.43234234)$. I also have about 20,000 points which are the ...
2answers
187 views

### how to improve efficiency when I want to classify a list according to certain laws

I have a function that generates lists: f[n_] := Join @@ Permutations /@ PadLeft@IntegerPartitions[n]; For example f[3] ...
2answers
219 views

### Generation function of recurrence sequence

I'm trying to find generation function of recurrence sequence ...
1answer
135 views

### Evaluating Abs'[2 x] gives different results than evaluating D[Abs[2 x], x]

I noticed the following difference Assuming[x ∈ Reals, FullSimplify[D[Abs[2 x], x]]] (* 2 Sign[x] *) Assuming[x ∈ Reals, FullSimplify[Abs'[2 x]]] (* Sign[x] *) ...
2answers
233 views

### Grid ItemSize is smaller than expected

If I execute MatrixPlot@IdentityMatrix@100, the result is a good size. However, if I evaluate ...
2answers
113 views

### How do I assign specific data points in an array to a new array?

I am trying to learn how to script/program in mathematica and I am retyping some simple C and FORTRAN programs into Mathematica as a way to learn. I am writing a Monte Carlo code to calculate the ...
1answer
326 views

### My black text isn't black after exporting to PDF

Consider any standard plot, with true CMYK black text: ...
1answer
203 views

### Solving an exponential multivariate equation

I have the following equation: p = 1/(1 + E^(-51.179 + 0.849 x1 + 2.3649 x2 + 1.155 x3 + 1.46 x4 + 1.31 x5)) and I want to find the set of values for x1 to x5 ...
1answer
407 views

### plotting xy, yz, zx plane at

I have a data list in the following form, data = {x, y, z, f} I would like to present three kinds of subdata set as a density (or contour) plot on the ...
3answers
258 views

### finding anagrams

What I'm trying to find are the 4 letter words in the mathematica dictionary that have the most anagrams and the amount of anagrams these have each. But I can't seem to find all the 4 letter words in ...
4answers
43 views

### How to multy-Set a group of lists?

I have a group of lists, for example: lists = RandomInteger[10, {100, 2}] {{6, 7}, {7, 4}, {3, 3}, ....} Now, I want to ...
1answer
166 views

### How to return the rhs of a transformation rule from within Compile[]

I have defined the following function: ...
1answer
67 views

### map rational number [duplicate]

I am trying to map this function ((-1)^(1/Denominator[#]))^Numerator[#]==(-1)^#& to a fairly big list of random rational numbers I am trying to get this to ...
1answer
75 views

### Is it possible to merge cells excluding results with one click?

Now when I merge two cells with right-click "Merge Cells", they merge with the results included, while I only want the commands merged. Can I make it a one-click button? Now I have to delete the ...
1answer
89 views

### Plot producing many error messages when given complicated function

I'm new to Mathematica and am running in to all sorts of silly difficulties with coding in it. I'm trying to calculate a function f[x, k], normalise it with another ...
3answers
328 views

### Draw plot with locator & slider

I would like to create a plot whereby both the slider and the locator 'draw' the plot. In the following code, the locator & the slider act independently: ...
1answer
230 views

### Visualization of iteration procedure in NMinimize

I have this optimization code: ...
1answer
121 views

### Strange behaviour of Internal`InheritedBlock

I was going to post an answer for fast way to replace all zeros in the matrix. I was even quite happy because timings were the same order of magnitude as others. The idea was to overwrite ...
1answer
82 views

### What's wrong with my implementation on CountryData

I was wondering, *for which countries is the proportion of Phone line users to population greater than or equal to that of the United States?* This is what I inputted below, but the list of countries ...
3answers
15k views

### MathLink linking error after OS X 10.9 (Mavericks) upgrade

After macosx 10.9 mavericks upgrade i have a compilation problem, you can see below. Even the examples given in ...
4answers
266 views

Given: ...
1answer
310 views

### Import symbolic variables from Matlab with MATLink

I'm trying to manipulate with Mathematica symbolic expression created in Matlab. I'm using the MATLink package, and I've succedeed in importing numerical variables, but not symbolic ones : ...
1answer
750 views

### Solve a PDE on a domain $\Omega$ with given boundary conditions

I'm starting to study the behavior of some PDEs and I would like to run simulations in mathematica to help me visualize solutions. For example, a prime example that I would like to study is  ...
0answers
117 views

### Esc-esc for special characters and autocomplete in Mathematica 9 [duplicate]

I recently upgraded to Mathematica 9 and have noticed a slightly annoying behavior that I was looking to remedy. In the past I would type special characters, e.g. ...
1answer
728 views

### Plotting multiple lists of complex numbers

The user #Nasser showed an elegant way to plot complex numbers: ...
5answers
379 views

### What is the fastest way to replace all zeros in a matrix?

In the following matrix m every 0 should be replaced with a 1: m = {{0,1,2},{5,0,3},{8,0,0}} Desired result: ...
1answer
563 views

### How to I display the value of my plot function?

I've plotted a function that varies with respect to time. It's inside a manipulate box, which can vary the time. And I'd like to display the value of the function at the time on the slider on my plot. ...

15 30 50 per page