8
votes
2answers
131 views

Passing an unevaluated part of an association to a function

I'm making a UI widget that controls sound volume on a speaker using a slider, e.g.: ...
8
votes
1answer
103 views

Iterator variable not blocked in ParametricPlot

Bug introduced in 10.0 and persisting through 10.2 or later It appears that perhaps the iterator variable r is not Block-ed ...
8
votes
1answer
202 views

Decomposition of a semialgebraic set into connected components

Is there any built-in function for doing decomposition of a semialgebraic set into connected components? The only way I now can think of is to use ...
8
votes
8answers
756 views

Replace interior of matrix with zeros

I have f.e. the following square matrix: ...
8
votes
2answers
729 views

Finding differences between Pi with varying number of decimals

I have the following code In[32]:= N[Pi, 2] Out[32]= 3.1 In[33]:= N[Pi, 1] Out[33]= 3. In[34]:= N[Pi, 2] - N[Pi, 1] Out[34]= 0.*10^-1 Why can't Mathematica ...
8
votes
4answers
353 views

Generate PrimePower counting function

Is there a way to generate a counting function for prime powers - i.e. to create a similar function to PrimePi, but including prime powers. The following will, of ...
8
votes
1answer
534 views

How can I scale a plot in vector graphic or PDF form?

I am not at all a computer graphics expert, but it seems that portable document format (PDF) files have a "native size," even though they may (and usually do!) contain vector graphics that can be ...
8
votes
2answers
877 views

How can I plot a loxodrome?

Can someone show me how to plot a rhumb line (loxodrome) in Mathematica via the ParametricPlot function? Here is what I got so far: ...
8
votes
3answers
537 views

how to read in a file in the same directory?

Now I am writing a small package. I have written several files and put them in the same directory. And some files need to read in or include another file in the same directory. But when I simply write ...
8
votes
2answers
206 views

Keywords to find documentation for this syntax

Mathematica allows this syntax, but I cannot find any documentation (or books) that discuss the various uses/advantages of it ...
8
votes
1answer
1k views

Why does Export drop namespace prefixes in the exported XML file?

I am trying to generate an Excel-compatible XML file from Mathematica. First, I created a test XML file by saving a Microsoft Excel workbook as "XML Table". Then I ...
8
votes
3answers
879 views

Plot3D in Mathematica: how to plot in presence of parameters

I realize I the earlier question was ill-posed. To clarify: I am trying to find the values of $A$ and $B$ that will maximize a function f on the domain ...
8
votes
2answers
404 views

Retrieving duplicates from nested list

Consider the following: data={{1,a},{10,a},{5,b},{4,c}}; In my case duplicates are defined when for {x1,y1} and ...
8
votes
5answers
580 views

simplifying $\frac{\log x^a}{a} = \log x$

If one makes the assumptions $x>0,a>0$, then $\frac{1}{a}\log x^a = \log x$. Thus, in Mathematica, Simplify[1/a*Log[x^a], {a > 0, x > 0}] returns ...
8
votes
1answer
473 views

CDF and personalized style

I recently created a custom stylesheet. I then created a notebook with the new style, confirmed that the notebook had adopted the style, and then saved a copy in CDF. But when I opened the CDF in ...
7
votes
2answers
65 views

How to Add a PageBreak menu by MenuSetup.tr

In 1998 there was a discussion on comp.soft-sys.math.mathematica how to add am PageBreak menu to Mathematica. I used the recipe from there for very long time (in fact, I used Mathematica 4 till ...
7
votes
0answers
110 views

Monitor function doesn't show continious change of values

Bug introduced in 10.0 and persisting through 10.3 Mathematica version: 10.2 Monitor[i = 0; While[i < 100, Pause[0.1]; i++]; i, i] The above code is from ...
7
votes
1answer
138 views

Why don't 1. (0. + a) or (0. + 1. a) simplify?

I'm handling some mixed-numeric-analytic expressions, and I feel I'm missing some subtleties of how Mathematica handles simplification of such expressions. In particular, I was initially puzzled by ...
7
votes
3answers
345 views

Coloured image transformation in pointillism

I would like to transform an image (a photo for example) into a set of single colour circles with fixed but adjustable diameter (bigger than the pixel size), into a kind of pointillism. The number of ...
7
votes
3answers
298 views

How to efficiently get breakpoints of piecewise functions

Setting. Imagine that we have several arbitrary linear functions in 2D that can be changed manually (say, slopes are parameters). Their Min (or ...
7
votes
5answers
252 views

How to write an operator that acts on pure function (to give another pure function)

I would like to write an operator oper that acts on a pure function f with an undetermined number of arguments, with the syntax ...
7
votes
2answers
195 views

Speed and the MapThread function

Can anyone help explain why MapThread is so slow in this simple case? ...
7
votes
2answers
290 views

Generate cyclic list from a list

Given a list (for example, {3, 5}) I would like to make a function genCyclic[n_, list_] which generates a cyclic patterns of ...
7
votes
3answers
333 views

Appending and Prepending columns to a dataset in 10.0.2.0

fixed in 10.1 (windows) I just experience a problem in prepending columns to a dataset. I did this a hundred times in 10.0.1.0 - no problems. Now it seems as if it is only possible to ...
7
votes
3answers
277 views

Drawing a graph with vertex avoiding edges? (Handling vertices that must be colinear?)

I'd like to draw something like the following graph: ...
7
votes
1answer
736 views

Plotting a moving ball for projectile motion with animate

Here is my code for plotting an orbit. What I want to do is have the "planet" shown as it orbits in the simulation. Can anyone help with this? ...
7
votes
4answers
936 views

How to find all data points within closed curve

I want to find all data points inside curve as given below: ...
7
votes
1answer
140 views

Converting string representation of boxes into explicit boxes

It is very easy and convenient to write textual labels as Strings in the WYSIWYG mode. For example, I define a short form describing a linear model: ...
7
votes
3answers
781 views

How to fix this memory leak

I am using halirutan's code in this thread to unflatten a list. It works very well but the problem is that the Module's local function f is not deleted when the ...
7
votes
2answers
547 views

How to make a point's position time-dependent given a formula for the next step?

I've made a program that is just some points on a plane. Red points are cops and green points are robbers. Each point has a vector indicating where it is going to be in the next step of $t$. Right now ...
7
votes
6answers
213 views

How to join held Lists?

Let's say I have a = Hold@{2+2} b = Hold@{4+4} How can I get Hold@{2+2,4+4} ie join the two held lists ? More ...
7
votes
2answers
624 views

Export list elements each to it's own page in a multi-paged PDF document

I have a list, myList, of let's say 20 (different) objects myList = Table["object", {20}] I know would like to export every ...
7
votes
1answer
230 views

Symbolic tensor simplifications and the identity matrix

How can I get Mathematica to simplify the following expressions, with $Assumptions including Element[n,Integers], n > 0, and ...
7
votes
1answer
316 views

Series expansion for small ratio of variables

I have a messy expression of variables that I would like to simplify under the assumption that certain ratios of the variables are small. For example, consider $\sqrt{x+y}\;$ expanded for small ...
7
votes
2answers
260 views

Programatically adding/retaining comments within a nested list

Is it possible to convert the following list of strings to computable numbers with the comments preserved? ...
7
votes
4answers
862 views

How to collect terms with positive powers in polynomial

I am trying to collect all terms with non-negative powers of $x$ in polynomials like $\frac{1}{x^2}\left(a x^2+x^{\pi }+x+z\right)^2$ First expand the polynomial ...
7
votes
3answers
713 views

Color function doesn't span the whole color range in MatrixPlot

In matrix visualization, for instance, MatrixPlot[{{1, 2}, {3, 4}}, PlotRangePadding -> 0, ColorFunction -> "Rainbow"] the color map does not cover the ...
7
votes
4answers
771 views

How do I display an expression with negative powers?

How do I display an expression with negative powers? Mathematica seems to always invert a term with a negative rational power. None of the following work: ...
7
votes
3answers
2k views

Failed to connect remote Mathematica kernel using J/Link

I'm trying to connect to a remote Mathematica 8 kernel (on a Windows machine) using J/Link. On the client machine, I put the JLinkNativeLibrary.dll file in ...
7
votes
1answer
1k views

Grain(Particle) Size Distribution (PSD) Analysis with Mathematica

I would like to do an analysis of the grain size distribution of a Monte Carlo Grain Growth simulation I implemented based on the nice example by Rituraj Nandan (see Link). The result of this ...
7
votes
1answer
378 views

How to make the docked cell and the navigation toolbar in the Slide Show?

I have a notebook with a docked cell displaying a banner with some graphics. When I convert this notebook to the Slide Show the banner is nicely displayed on each slide. But the Navigation Toolbar is ...
7
votes
1answer
210 views

Prevent interdependence of controls

My question is probably best illustrated with this small sample code: ...
7
votes
3answers
1k views

How to rotate TickMarks in DateListPlot?

Is there a way to rotate TickMarks in DateListPlot to avoid overlap, eg: Part of the code used to generate this is: ...
7
votes
1answer
432 views

Combining and aligning “chart” type graphics with regular plots

Is there an easy (recommended) way to align regular plots (e.g. ListPlot or Plot) with chart type graphics (...
7
votes
1answer
480 views

How to create a multi-selectable setterbar with colored buttons

Background: consider the following code-snippet. ...
7
votes
1answer
1k views

Simplify an expression containing NonCommutativeMultiply

How does mathematica evaluate the following expression to zero: ...
7
votes
3answers
333 views

Why can't D[] be used in place here? [duplicate]

Possible Duplicate: General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it? Beginner question: Why can't I use ...
7
votes
2answers
380 views

Revert FullForm-ed text to prettyprinted

Sometimes strings in a notebook/package file end up garbled due to some unknown/unintentional conversion of the expression/cell/notebook. I could not find a way to revert such unreadable text to its ...
6
votes
2answers
78 views

How to define a complicated function inside the body of Compile?

I want to compile a function in a way to keep its memory footprint down. In the example below, I am trying to compile a function f that makes three calls to ...
6
votes
1answer
137 views

NDEigensystem producing imaginary eigenfrequencies for the vibrations of a cantilever [closed]

We are trying to use NDEigensystem to solve for the vibrational modes of a cantilever with triangular cross-section. However, many of the solutions provided by NDEigensystem have imaginary ...

15 30 50 per page