10
votes
1answer
5k views

Complex number operations: telling Mathematica variables are real

I want to do Conjugate[a + b*I], but when I do that, the solution is Conjugate[a] - I*Conjugate[b]; when for me, a and b are ...
10
votes
2answers
3k views

problem with coloring spherical harmonics

I want to color a spherical harmonics. So I write as follows. ...
10
votes
2answers
535 views

Why does ListPlot ignore some global options?

Bug introduced in 7.0.1 or earlier and fixed in 8.0.1' Why does the following plot no use the global PlotMarkers option? ...
10
votes
1answer
144 views

Is it possible to use the global definition of a symbol as part of its new local definition set in a Block?

Consider the following expression: Block[{Print = CopyToClipboard}, doSomething[]] Now all calls to Print from ...
10
votes
6answers
680 views

Flatten nested lists

I have a list as follows lis= {a, {{{b}, {c,d,e}}, {{f}, {g,h,i}}}} which I would like to flatten to ...
10
votes
4answers
462 views

Finding a point from a set of contours such that it is nearest to a given point

I have several contour lines and one point. How can I find a point in one of those contour lines which is nearest to the given point? ...
10
votes
1answer
265 views

How to pass composite function list to SortBy?

In order to sort alphanumeric-as-string data of the form {"T3", "T14", "T1", "E2"}, so that "T14" comes after ...
9
votes
1answer
358 views

Front end crash on Export in 10.2 on OS X

Bug introduced in 10.2.0 and fixed in 10.3.0 Appears to be specific to OS X Mathematica 10.2 is reliably crashing for me when trying to export a pdf that has text with ligatures. For example: <...
9
votes
1answer
287 views

How do I determine astronomical transit times?

Mathematica, through the "legacy" Scientific Astronomer package, used to have the ability to easily determine accurate transit times of astronomical objects simply, with ...
9
votes
1answer
133 views

Filling option failing when ListLinePlot given my data

Context I want to do Filled plot such as: ...
9
votes
1answer
1k views

Simplify an expression containing NonCommutativeMultiply

How does mathematica evaluate the following expression to zero: ...
9
votes
2answers
5k views

Inverse of a complicated function

Mathematica is struggling to find the inverse of this function f(r): ...
9
votes
2answers
383 views

Define Log so that negative reals evaluate on lower edge of branch

I need to get Mathematica to evaluate the logarithm of a negative real number using the lower branch instead of the upper branch, so that while ...
9
votes
3answers
278 views

Selecting items in a list based on multiple conditions

This question has been solved. Thanks for all your help! I have data that looks like this. ...
9
votes
2answers
203 views

Substituting confidential tagged cells by a “content removed” cell

When producing a notebook with both code and text, I often end up with pieces of code, or even entire chapters, that I don't want to be shown on the final output. I generally hide or close them by ...
9
votes
1answer
349 views

Caching of Graph Graphics

In this answer, Simon Woods concludes that when you display an expression with head graph more than once, something is getting stored somewhere. I looked into it too and found out this only happens if ...
9
votes
3answers
398 views

Generalization to AllTrue, AnyTrue and NoneTrue

I am wondering if there is a natural Mathematica way to generalize those functions. To be specific, All three functions AllTrue, ...
9
votes
3answers
2k views

Why don't * and ^ work as I expected on matrices?

For example, this input... {{1, 2}, {3, 4}}*{{1, 2}, {3, 4}} produces this output... {{1, 4}, {9, 16}} and this input... <...
8
votes
1answer
107 views

Framing a combination of cells in the notebook

In my notebook, I have the following cells, which I tried to put around a single frame with a light blue background color. After entering the cells, I selected all four, then clicked the frame ...
8
votes
1answer
578 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
3answers
253 views

How to count all cliques (not just maximal ones) in graphs?

How can I count the numbers of $r$-cliques in a graph? In other words, the number of triangles, the number of $K_4$, the number of $K_5$ etc. I have tried for example ...
8
votes
1answer
483 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 ...
8
votes
1answer
396 views

Treat all variables as local in a module [duplicate]

In most languages, any variable defined inside a function is considered local. ...
8
votes
1answer
152 views

How to grab output from evaluating input cells in a generated notebook

The notebook expression resulting from ... ...
8
votes
8answers
761 views

Replace interior of matrix with zeros

I have f.e. the following square matrix: ...
8
votes
1answer
106 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
2answers
210 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
2answers
414 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
1answer
110 views

PlotMarkers shadows the settings by Style

The code below gives color-varying points with explicit Style wrappers: ...
8
votes
2answers
749 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
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
4answers
359 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
234 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
2answers
277 views

Remove versus ClearAll

What is the difference between Remove and ClearAll? I thought that "not being recognized by Mathematica", which is the effect ...
8
votes
2answers
423 views

Finding All Chordless Simple Cycles In A Graph

I am doing a research on networks which consists of polygons with different number of sides. I am trying to find all simple cycles in a network which are chordless. As an example, consider the ...
8
votes
1answer
456 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 (...
8
votes
2answers
197 views

Obtain input expression from history without evaluating

I typed and evaluated an expression, but deleted it from the notebook. For instance, suppose it was In[1]:= Round@SessionTime[] Out[1]= 2 I now want to retrieve ...
8
votes
2answers
900 views

Indenting bulleted lists in Notebooks

I currently use Word for notes, making nested bulleted lists as I go. I've just started using Mathematica and would like to do the same in its Notebooks, but it doesn't look like it has that ...
8
votes
3answers
597 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
710 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
0answers
129 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
2answers
264 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
1answer
281 views

How to “undo” SetOptions (restore defaults)

Say I had some good reason to use, for example SetOptions[Plot,ImageSize->500, LabelStyle->OutrageousPink]; But now sometime has passed, life has changed, ...
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
4answers
870 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
1answer
345 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
195 views

RegionIntersection puzzle

I am using RegionIntersection[] to intersect two rectangles, phrased as Polygon[]s: ...
7
votes
5answers
274 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
1answer
523 views

Export to PDF on OS X, font missing on Windows

Here is another problem with Mathematica plots and PDF. I have Mathematica 9.0.1 on Mac OS X. I want to export my plots to PDF to include them in a LaTeX document. If I export the plot with the ...

15 30 50 per page