# All Questions

266 views

### Computing the mean difference between elements in a list with index $i$ and the closest elements with index $(i+1)$

I have a list that looks like this: preprocessedList = {{1,5.3},{1,5.566},{1,1.4322},{2,3.443543},{2,3.444},{3,0.1223},{4,1.3243},{4,1.554343}} Each element in ...
109 views

### How to check if a Polynomial has a specific form

I have a polynomial F[x], for example F[x] = 1 - 2x + x^2. I wanna check whether F[x] has the form of ...
261 views

### How to avoid unpacking from LanguageExtendedFullDefinition

Consider this code: LaunchKernels[]; On["Packing"] a = RandomReal[{0., 1.}, {64, 30000}]; ParallelMap[Fourier, a]; // AbsoluteTiming Developer...
666 views

### How to define custom operators

I am currently running Mathematica 8 and I would like to know how to define custom operators. Let's say I define an operator called $\times$ where: $$a\times b = a+a\cdot b+b$$ I also want to know ...
109 views

### Maintaining stylesheet information in Cell[]

I am working on formatting a cell for a slideshow presentation format such that a graphics object occupies the left half of the cell and bullets or other items occupy the right. The ancient ...
165 views

### Issue with Coefficient command

I'm trying to used the Coefficient command to extract the numerical values in front of a Chebyshev polynomial. I know that there is a numerical way to do this, presented in numerical recipes, which I ...
150 views

### Selecting for morphological components that do not border the edges of an image?

Is there an easy way to select for morphological components which do not border/touch the edges of an image? Taking this doodle as an example: We'd want to only select morphological components ...
266 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 ...
100 views

### How to extract input part of a notebook?

For example, how to make Mathematica display only the lines beginning with In[some number]? ...
279 views

144 views

### Plot an implicit function containing the correlation of two vectors

I am trying to do something like this: ContourPlot3D[ Expand[Correlation[{0, 1, 2}, {b1, b2, b3}] == .5], {b1, -5, 5}, {b2, -5, 5}, {b3, -10, 10}] But ...
132 views

### Conditional printed output [duplicate]

I would like to use a Mathematica notebook as a printable document with conditional output. If the condition is true, some parts of the notebook should be printed; otherwise they should not be ...
185 views

### How can one write a robust ListableQ function?

I would like to have a test that determines if a particular function is Listable. In the case of Symbols this is merely a matter of checking Attributes. ...
111 views

### The space in default output of ExportString to Latex

Are there any reasons for converting subscriptbox to Tex with space? ...
617 views

### Removing Abs from Abs[a + Exp[I*c]b]^2

Title says it all. Mathematica produces sometimes expressions of the form Abs[a + Exp[I*c]b]^2 where all three quantities a, b and c are positive real numbers. ...
271 views

### Clustering of peaks in 2D spectra

I'm having some problems clustering data in a 2D spectra and will really appreciate some help. I've been playing around with the FindClusters function but wasn't able to tune it appropriately. Maybe ...
441 views

### Select sublists with second element nearest to zero

I've got some big lists from which i need some data (one of the big lists). To be specific, I need to divide this biglists in sublists of the same length (10000), and form a new list with the mean of ...
1k views

### How to plot logarithmic scales

How can a simple logarithmic number line be drawn between any 2 integer values? The closest function I found in the documentation is LogLinearPlot[] and I've ...
619 views

### How to partition a list to make each subset's size equal and mean as close as possible

Suppose we have 3 lists each with 18 numbers like this: ...
133 views

### Getting Values From Quaternions

I'm using the Quaternion package: << Quaternions Very simply, I would like to be able to get the individual components of the quaternions by themselves. ...
1k views

### Run entire notebook

I have created a notebook, with functions. The only thing that I want to change in the notebook later is the input file. I therefor want to have a button that runs every input step-by-step so that I ...
354 views

...
901 views

### MATLAB To Mathematica: How to implement imshow()

I want to implement the MATLAB imshow function in Mathematica. This is a DensityPlot[] from Mathematica And this is ...
302 views

### A problem with polynomial root finding

I use the expression ...
130 views

### Extracting lists from list based on length

I have a list looking like this; ...
150 views

Looking at the LibraryLink examples, there are several new functions and objects, as well as example programs, that appeared in version 9. Are these documented? If yes, where? If would be nice to ...
255 views

### Removing commented lines of text in a string

Suppose that I have a string str. str contains headings -- which are written in commented lines -- and data. For example: ...
271 views

### Summa package problem

I need to use the features of the Summa package but it doesn't work in Mathematica 9. It gives the error Cannot open UtilitiesFilterOptions My question is: ...
127 views

### Using sublists returned from a function as elements of a list argument to an other function

This is a contrived example, but it gets the point across. I am looking to use the following as inputs: ...
290 views

### NestList with a list inside?

I'm new to Mathematica, and was looking for more efficient ways to implement the Do loop below. a, ...
496 views

### How to visualise an iterative approximation to pi

I'm experimenting with different algorithms that approximate pi via iteration and comparing the result to pi. I want to both visualise and perhaps know the function (if any) that describes the ...
186 views

### CUDALink ran out of available memory

I have a problem with automatic GPU memory management when using CUDA. The situation is the following: I create a simple CUDA function that operates on a 2D array (image), which does not take much ...
125 views

### Export a Grid in a xls file naming the sheets

I try to export two grid in a same xls file, naming the sheets. This is an exemplification of my issue, and it doesn't work. ...
381 views

### How to implement this simple product rule in mathematica [duplicate]

Firstly i have defined a simple function below. dotPro[a_, b_] := a[1]*b[1] + a[2]*b[2]; Then i create two terms using the above function. ...
307 views

### How to force an evaluation to use only one core?

There are some evaluations which are automatically parallelized or multithread if there are cores available.( for example, Eigenvalues) But I don't want the ...