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
358 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
815 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
583 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
837 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
808 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: ...
0
votes
1answer
116 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
257 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
426 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
169 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
108 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
320 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. ...
7
votes
1answer
264 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
1k 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 ...
11
votes
2answers
405 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 ...
3
votes
0answers
55 views

How can I append Mathematica variables to an output file preserving both names and values? [duplicate]

I have a Mathematica program that calculates a series of large vectors that I need to save for future reference (in addition to some scalar values). I want to save all these to a file, tagged by their ...
1
vote
1answer
113 views

User-defined Distance Functions with extra parameters [duplicate]

The Nearest function accepts a customized distance function. For example, a simple case that works well is ...
17
votes
3answers
597 views

How is + as an infix operator associated with Plus?

How is + associated with Plus? Suppose I want to define a head FooBar and have it ...
3
votes
1answer
131 views

How can I speed up my compiled function that is returned by another function?

Overview I have a function that acts like the Interpolation on sparse $n$-dimensional data using a simple implementation of RBF interpolation method. I want my ...
3
votes
0answers
179 views

Generating an obstacle-avoiding closed-curve with a fixed perimeter and a target area

I was wondering if there was a neat way to solve the following problem in Mathematica v9 - Provided a binarized image (where we call black pixels "obstacles" or vice versa, whichever is most ...
3
votes
1answer
177 views

Optimization of power tower fractal generator [closed]

I tried to optimize the code for generating power tower fractals from here. As the author suggested, I tried to memorize the points already tested in a list. Here is my code : ...
5
votes
1answer
171 views

CMYK colour using Drawing Tools

I'd like to use the Drawing Tools palette to draw objects in CMYK colour. The only way I seem able to change the colours of these objects is to use the window shown below. Edit Is there a way to ...
3
votes
2answers
130 views

LineGraph Labels

I have a graph with labels on the edges: ...
1
vote
1answer
88 views

Collect the multiple of one determinant?

m = {{2, 6, 4}, {2, 6, 5}, {-3, 6, 6}}; Consider I'm doing calculation by hand. I want to collect the multiple 6 of second column, how to do that? I'd like the ...
6
votes
3answers
1k views

Circular Plot and Circular Histogram

The spherical or circular data arises when we measure data in degree e.g wind direction, clock and compass etc. Then representation of such data we need to plot circular plot, circular histogram and ...
11
votes
2answers
454 views

“Reset” Button for Manipulate

I want to distribute a .cdf to my students wherein they manipulate 5 locators on a graph to define various shapes. The .cdf opens with the locators in a "nice" position, but of course it is very hard ...
3
votes
1answer
113 views

Displaying the meaning of an operator using Information

I'm using CircleTimes ($\otimes$) operator defined as a_\[CircleTimes]b_ := KroneckerProduct[a, b] so I can use ...
2
votes
2answers
201 views

How to pick out specific parts of the solution of a differential equation efficiently?

I'm trying to solve a set of differential equations (in parallel) and then select specific parts of the solution. What I have at the moment (see below-I've simplified the differential equations, in ...
0
votes
2answers
127 views

How to add variables to boolean expression and get conjunctive normal form?

I have the boolean expression (a && !b). I want to add variables c, d into the ...
7
votes
0answers
115 views

How can I obtain the absolute settings of some Grid options?

For example: Grid[{{10!}, {5!}}, ItemSize -> Full, Frame -> All] What's the real value of Full? How can I map the ...
5
votes
1answer
97 views

Syntax formatting when Condition is used with Blank

Consider the following codes: x_/;x>y Condition[x_,x>y] Condition[Pattern[x,Blank[]],x>y] All the three codes are equivalent. As we can see, in the ...
4
votes
3answers
998 views

Manipulate using a variable defined outside of the manipulate function [duplicate]

I want to do something like this: expr := x^e; Manipulate[Plot[expr, {x, 0, 4}], {e, 1, 3}] But the plot shows up empty. Yes, it works if I do: ...
6
votes
2answers
623 views

Alternate parameterization of a line

There are several ways to specify a line. In Mathematica's graphics, it is done by specifying two points and then connecting the points with the Line command. But ...
4
votes
0answers
165 views

Replacing and combining elements in a list [duplicate]

I am trying to increase the level of nesting in the following list while adding a 'tag' to each leaf: ...

15 30 50 per page