7
votes
1answer
99 views

Bug in GeneratingFunction?

According to the documentation GeneratingFunction[a[n],n,x]==Sum[a[n]x^n,{n,0,Infinity}] However, for $a_n=1/(n+2)$ I obtain ...
6
votes
5answers
769 views

Fibonacci Sequence Generator

I'm trying to write a function in Workbench which will generate a Fibonacci sequence starting with F0 = 0 and F1 = 1. So far I ...
12
votes
1answer
227 views

MapIndexed and Compile

I am having trouble compiling a function that uses the MapIndexed function on the second level. The compilation runs fine, but at evaluation time I get an error ...
5
votes
1answer
211 views

Selecting a list from a list of lists

In working through Programming Paradigms Via Mathematica (A First Course) I have come across this two part question: A permutation of length "n" is a list of the first n positive integers in ...
4
votes
2answers
132 views

Workaround for Import not supporting the \leqslant TeX macro

$\{A\leqslant x\leqslant B\}$ Copy the code into Notebook, and you'll lose the less sign, this can be rendered well in ...
3
votes
1answer
152 views

Plotting Uncertainty for a Sample of Functions

I am trying to produce a plot showing the variation in a sample of functions. It should look like this plot or that plot. I tried to use SmoothDensityHistogram. ...
24
votes
1answer
748 views

Cheat sheets or reference cards for Mathematica

In order to improve my workflow with Mathematica, I'm looking for cheat sheets. The purpose of such reference cards is to be printed and to stay on the desk during the learning of a new programming ...
1
vote
1answer
134 views

How to keep front and back colors of Polygon in Graphics3D same all the time [duplicate]

I want the same face color for a 3D Polygon when viewed from front or back or from any angle. i.e. I want the color not changed under any conditions. Front and ...
4
votes
3answers
225 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
97 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
246 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
443 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
105 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
147 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
132 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
236 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
86 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
234 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
542 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
143 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] ...
1
vote
0answers
83 views

Why does ParallelTable give different answer than Table [closed]

Consider the following code a0 = 6.; ls1 = ParallelTable[k, {k, -π/a0, π/a0, π/a0/100}]; ls2 = Table[k, {k, -π/a0, π/a0, π/a0/100}]; ls1 == ls2 (*False*) Why ...
11
votes
5answers
899 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
282 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
61 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
214 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 ...
1
vote
0answers
211 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
205 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
190 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
282 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
265 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
3k 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
928 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
139 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
128 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
177 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. ...
1
vote
1answer
83 views

The space in default output of `ExportString` to Latex

Are there any reasons for converting subscriptbox to Tex with space? ...
5
votes
3answers
454 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
260 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
359 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
823 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
584 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
120 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
846 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
345 views
7
votes
4answers
809 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
262 views

A problem with polynomial root finding

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

Extracting lists from list based on length

I have a list looking like this; ...
9
votes
0answers
146 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
229 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
231 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: ...

15 30 50 per page