4
votes
3answers
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 ...
4
votes
1answer
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 ...
5
votes
1answer
261 views

How to avoid unpacking from Language`ExtendedFullDefinition

Consider this code: LaunchKernels[]; On["Packing"] a = RandomReal[{0., 1.}, {64, 30000}]; ParallelMap[Fourier, a]; // AbsoluteTiming Developer...
2
votes
1answer
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 ...
5
votes
1answer
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 ...
1
vote
0answers
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 ...
2
votes
1answer
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 ...
10
votes
3answers
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 ...
3
votes
2answers
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]? ...
2
votes
1answer
279 views

How can I numerically solve for fractional functions and fractional derivatives?

I would like to plot fractional functions. Say $f=(\sin)^{1/2}(x)$. By that I mean that $f(f(x)) = \sin(x)$. Similarly I can define a half-derivative to be an operator such that $H[H[f(x)]] = ...
4
votes
2answers
723 views

density/histogram plot for date-time data

I have date and time data and want to plot its frequency histogram. Ideally I want to be able to customize the bin size (for example, every 5 minutes or a day). Anybody has this experience?
2
votes
1answer
145 views

Integral of GeneratingFunction

I know that GeneratingFunction can be used to compute the generating function $\sum_{n=0}^\infty a_n x^n$ of a sequence $(a_n)_n$ via GeneratingFunction[a[n],n,x] ...
11
votes
5answers
1k views

How can I simulate this animation of checking for prime numbers?

I can only implement a very simple one, I want to make my code look like that. Any better ideas? ...
3
votes
2answers
320 views

Integrating special functions

I would like to integrate the following function with Legendre polynomial and Gamma function. I am open to suggestions. ...
1
vote
1answer
63 views

Problem with indentation with a section having a RegularExpression

I have this line of code (a one-liner to import the Abaqus dispalcements!) ...
0
votes
1answer
314 views

Can I combine a manipulate plot and a plot of data from a file?

I am fitting a theoretical equation for a complicated curve to some experimentally measured data. As you might be aware, algorithmically quantifying 'goodness of fit' for a complicated curve is ...
2
votes
0answers
244 views

Script with command line argument

As a test I want a simple script to take a command line argument and print it to a file: ...
2
votes
2answers
207 views

Deleting parts of groups that do not have equal dates

Find the intersection of dates within the pair and remove the other dates & corresponding prices. Also keep the list in same format as it currently is in. Let me explain: Each stock has closing ...
4
votes
1answer
252 views

How to change front end setting “Parallel Kernel Configuration” in the code?

I'm trying to run Mathematica parallel on multiple nodes on a HPC, and I use the remote kernel tab in the "Parallel Kernel Configuration" settings to set the communication between different ...
9
votes
1answer
289 views

Why I only get 2X speedup when parallelized with 16 kernels

I'm trying to parallelize a function by ParallelTable, and it seems the speedup is not very good. I have 16 parallel kernels on my computer node: ...
3
votes
1answer
322 views

how to delete specific data from text file and then update it

I have a large text file. I read data from text file one at a time and check whether data agree with my condition. If not I want to delete that data in text file and update it. For example say my ...
25
votes
2answers
4k views

How to include Mathematica animation in a PowerPoint presentation?

Note: Cross-posted at Wolfram Community I want to include a Mathematica animation in PowerPoint presentation. My code is: ...
10
votes
4answers
1k views

How to find the domain and range of an implicit function?

For example, we have this curve: $$ x^2 + y^2 = 1 $$ Is there a function in Mathematica for finding out that the ranges for $x$ and $y$ are both [-1, 1]? What ...
1
vote
1answer
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 ...
3
votes
1answer
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 ...
12
votes
2answers
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. ...
2
votes
1answer
111 views

The space in default output of `ExportString` to Latex

Are there any reasons for converting subscriptbox to Tex with space? ...
5
votes
3answers
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. ...
6
votes
2answers
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 ...
2
votes
3answers
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 ...
8
votes
4answers
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 ...
15
votes
3answers
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: ...
4
votes
2answers
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. ...
1
vote
2answers
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 ...
8
votes
10answers
354 views
7
votes
4answers
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 ...
6
votes
1answer
302 views

A problem with polynomial root finding

I use the expression ...
1
vote
1answer
130 views

Extracting lists from list based on length

I have a list looking like this; ...
10
votes
0answers
150 views

What was added to the LibraryLink API in version 9?

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 ...
5
votes
2answers
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: ...
6
votes
1answer
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 Utilities`FilterOptions` My question is: ...
0
votes
1answer
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: ...
3
votes
1answer
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, ...
0
votes
2answers
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 ...
1
vote
0answers
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 ...
0
votes
1answer
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. ...
0
votes
2answers
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. ...
8
votes
1answer
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 ...
17
votes
12answers
2k views

Pick elements of largest absolute value

For example, given list = {{1, -3, -5}, {2, 1, 6}, {0, 2, 4}, {-9, 2, 6}} should return: {-5, 6, 4, -9} Updated I found ...
12
votes
2answers
448 views

Putting ticks with values on a parametric plot

I need to plot ticks with values on the following ParametricPlot[] The ellipse can be obtained by ...

15 30 50 per page