# All Questions

756 views

### Replace interior of matrix with zeros

I have f.e. the following square matrix: ...
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 ...
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 ...
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 ...
875 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: ...
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 ...
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 ...
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 ...
878 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 ...
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 ...
579 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 ...
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 ...
65 views

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 ...
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 ...
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 ...
344 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 ...
297 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 ...
250 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 ...
195 views

### Speed and the MapThread function

Can anyone help explain why MapThread is so slow in this simple case? ...
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 ...
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 ...
276 views

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

I'd like to draw something like the following graph: ...
729 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? ...
935 views

### How to find all data points within closed curve

I want to find all data points inside curve as given below: ...
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: ...
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 ...
545 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 ...
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 ...
622 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 ...
230 views

710 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 ...
770 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: ...
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 ...
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 ...
377 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 ...
210 views

### Prevent interdependence of controls

My question is probably best illustrated with this small sample code: ...
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: ...
431 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 (...
477 views

### How to create a multi-selectable setterbar with colored buttons

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

### Simplify an expression containing NonCommutativeMultiply

How does mathematica evaluate the following expression to zero: ...
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 ...
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 ...
132 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 ...
68 views

### Is it possible for librarylink function to be Listable like that in Compile? [closed]

We know in Compile, there is an Option RuntimeAttributes -> {Listable} which can let the compiled function easily explore the ...
105 views

### Mathematica with MongoDB database

I try connect mathematica with my database NOSQL mongoDB but I have problem with create collection. I have Mathematica 10.2 and I download driver .net version 2.2 from this website a link! I unpacking ...