17
votes
3answers
2k views

Way to improve “show me this decimal number to M places, don't use scientific notation”?

The best way I can come up with to say "show me this fraction as a decimal number to M places, don't use scientific notation" is: ...
4
votes
2answers
220 views

How to work around Column cutting off a pixel row from images?

I have a problem where Column will occasionally cut off a single pixel from the top of images. To reproduce the problem, evaluate this: ...
10
votes
4answers
469 views

Typography messed up in prints

For a long time now I've had trouble printing Mathematica files. While the .nb itself displays just fine on my screen, the kerning is awful when printed. Screen: Print: And in case you ...
19
votes
2answers
3k views

How to enter matrices in block matrix format?

Example: I have a matrix $R = \left( \begin{array}{cc} A & \mathbf{t} \\ 0 & 1 \end{array} \right) $ where $A$ is 3-by-3 and $\mathbf{t}$ is 3 by 1. Or in Mathematica ...
5
votes
0answers
614 views

Analytical model fitting

I have a special type of model fitting problem that I am trying to solve in Mathematica. Any insight how to attack it using available tools of Mathematica will be great to hear. We have a variable $$ ...
5
votes
3answers
409 views

Tile image on specific location without space between them [duplicate]

Possible Duplicate: How to combine images with the same dimensions in a grid? I would like to arrange images without any space between their edges as each piece is made to connect with ...
15
votes
2answers
2k views

Fontsize is too small

I have this annoyance for a long time now: every Text cell uses the default font size, though it appears too small on my screen. See comparison of same text, same font (Times New Roman), same fontsize ...
7
votes
2answers
274 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 ...
56
votes
5answers
9k views

$\LaTeX$ and Mathematica

I quite often would like to draw graphics in my $\LaTeX$ documents using Mathematica. I have encountered three problems. I would like to know if there are any workarounds to these problems I would ...
33
votes
8answers
7k views

What is the best Mathematica tutorial for young people?

As Conrad Wolfram said at the TED conference, in the future kids should focus more on new technology. Computers compute better than humans, so we should focus more on thinking and getting the ...
6
votes
2answers
424 views

Visualizing 3x3 spectrahedra

I'm trying to visualize the SDP cone over 3x3 matrices by plotting random 3d sections of it. Since each region is a system of inequality constraints, I'm using RegionPlot, but I think the plots would ...
6
votes
3answers
167 views

Does there exist any way to add type annotations?

Is there any way to add my own annotations to values or functions in Mathematica? Imagine, for example, that I wanted to annotate a List specifically as a ...
7
votes
1answer
564 views

Using Mathematica to help to determine the consistency of and numerically solve systems of non-linear equations

The formal problem The question I am about to ask is applicable to many scientific and engineering problems. In short, I am bout to ask for pointers and practical advice for Mathematica beginners who ...
12
votes
3answers
424 views

With versus Function

I've seen people compare Block with Module and With as scoping constructs, and try to figure ...
42
votes
6answers
2k views

Functions vs. patterns

Every time I define a new function, I wonder which construct I should use: true functions obtained by using Function, or rule-based syntax. For example, these are ...
7
votes
2answers
367 views

Ideas on how to improve the rendering of the letter B in this 3D region plot?

I have been playing with the RegionPlot3D idea from this question and have been trying to approximate the Gödel, Escher, Bach logo, but I am a little bit stuck on how to improve the rendering of the ...
13
votes
3answers
356 views

What is the purpose of tags like :Name:, :Context:, etc. in packages?

I noticed that all of the packages that come with Mathematica start with a header that is in a standard format. (See e.g. the header of NIntegrateUtilities` at the ...
13
votes
3answers
2k views

I'd like to display field lines for a point charge in 3 dimensions

I'd like to display field lines for a point charge in 3 dimensions. Not a force field (short arrows) but continuous field lines that start on the charge.
6
votes
3answers
301 views

How to eliminate the need to double evaluate a Manipulate so that a Module in its Initialization section works?

Using V 8.04 on windows. I think this issue might be related to the fact that Mathematica reads main body the Manipulate before evaluating or running the Initialization option. Or, might be ...
18
votes
3answers
3k views

How to Keep Input Cells Hidden After Evaluating Notebook

I've created a notebook for use in an in-class presentation. There is a fair amount of MMA code, and my students know nothing about MMA nor do they need to. I don't want to distract them with the ...
7
votes
1answer
366 views

Using NETLink.MathKernel.Compute() for graphics results fails with GraphPlot[]

I'm using MMA 8.0 to provide backend on a .NET application I'm writing. I am trying to use the high-level Wolfram.NETLink.MathKernel interface to export an image ...
5
votes
3answers
363 views

Code Golf: Least Common Multiple

"CodeGolf" challenge: write the shortest practical Least Common Multiple function that: Does not use built in GCD, LCM or any ...
10
votes
2answers
358 views

Specifying the ports used by LinkCreate or LinkLaunch

Whenever a Link is created using LinkCreate or LinkLaunch with ...
15
votes
2answers
3k views

How to install packages?

This is always a problem when I distribute my packages to colleagues working on different platforms. I have my packages installed into a private directory and I autoload some of them when Mathematica ...
8
votes
2answers
610 views

Why is JLink loaded every time I start Mathematica?

When I start a Mathematica 8 session (either command line or with the notebook front end), I notice that there are several packages that have already been loaded for me (using ...
9
votes
4answers
826 views

Create shortcut in Mathematica for “Equal Symbol Aligned Math Cell”

How do I create a new shortcut for creating a "Equal Symbol Aligned Math Cell" in Mathematica 8? Update I meant a keyboard shortcut. An "Equal Symbol Aligned Math Cell" is exactly what @Heike ...
4
votes
2answers
257 views

How to close the front end so I can clear all Global variables?

I first thought that doing Quit[] in a cell, or Evaluation->Quit kernel, is supposed to remove all Global variables, but I have a case where this is not happening, then I read that there is a command ...
15
votes
3answers
361 views

Practical uses of DynamicWrapper

I am looking for practical uses of the function DynamicWrapper . I read documentation and know whatever it says. I would appreciate a clear example of a useful ...
8
votes
2answers
2k views

Printing a string in a Mathematica script

Here's a simple script saved in the file hello #!/usr/local/bin/MathematicaScript -script Print["Hello world"] I can then run ...
30
votes
1answer
1k views

How can all those tiny polygons generated by RegionPlot be joined into a single FilledCurve?

RegionPlot will usually generate a large number of tiny polygons for filling the region: ...
32
votes
7answers
2k views

Character edge finding

The following line of code finds the edge of a character: ...
12
votes
1answer
931 views

Error checking and trapping techniques with Throw and Catch

Mathematica provides several mechanisms for checking arguments and trapping errors in a function definition. Typical methods are : Definitions with argument patterns, definitions with ...
25
votes
3answers
2k views

How to embed fonts when exporting Mathematica graphics as PDF

Upon exporting a Mathematica graphics expression as a PDF, Mathematica does not seem to embed any nonstandard fonts used. When you open the resulting PDF document with a PDF viewer, all the text items ...
74
votes
4answers
13k views

1 Plot, 2 Scale/Axis

I would like to plot those two datasets on top of each other. But they have very different range on the $y$ axis. How can I have two different axis? I found the following on the help menu but quite ...
4
votes
3answers
293 views

Plotting data with exponentials

I have some data with 19000 sublists such as : {" 7.9080000e+01 1.9283193e+04"} Where the first number is the value for variable ...
10
votes
5answers
786 views

Connecting to and disconnecting from a continuously running kernel, on demand

I realized that there are lots of advantages to driving C/C++/FORTRAN code directly from Mathematica as LibraryLink functions (instead of running them from the command line or a shell script, as I ...
6
votes
1answer
234 views

Is the communication protocol underlying MathLink user-customizable?

MathLink supports two communication protocols on all platforms: TCPIP or shared memory. There are additional protocols supported on some systems only ("FileMap" and "Pipes" according to the docs). I ...
14
votes
3answers
3k views

How to generate random directed acyclic graphs?

How to programmatically build random directed acyclic graphs (DAG)? I know about the AcyclicGraphQ predicate and the ...
9
votes
1answer
173 views

Future-proofing access to packed array tools

Most of the Mathematica users beyond beginner level will be aware of the phenomenon of Packed Arrays. The user-accessible functions related to packed arrays live in the ...
18
votes
4answers
697 views

Why does Mathematica claim there is no even prime?

I wonder if this is a bug, or if I'm misunderstanding something: Exists[n, EvenQ[n] && PrimeQ[n]] // Resolve (* ==> False *) So if I interpret this ...
7
votes
5answers
300 views

Why is FindInstance finding non-instances?

Consider this example: FindInstance[Exists[{x, y}, x > 1 && y > 1 && x > Sqrt[x + y]], {x, y}] which finds values of $x$ and $y$ such ...
13
votes
1answer
358 views

Is it possible to use Begin and End inside a Manipulate?

May be someone can explain why I can't use Begin["context`"] and End[] inside a Manipulate ...
17
votes
4answers
378 views

Function that caches when it returns unevaluated

How would you go about implementing a function that caches not the result but the fact that it didn't match a pattern? So that it doesn't waste time recomputing a complex time-consuming pattern ...
6
votes
6answers
579 views

How can you give a Module a context and have its local variables and Modules belong to that context?

What would be the best way to give a module its own context and have its local variables and Modules belong to that context?
15
votes
2answers
376 views

Distributing PlusMinus consistently

I would like to give the built-in function PlusMinus, which is undefined by default, the intuitive meaning: considering all possible combinations of $+$ and $-$. ...
8
votes
3answers
837 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... ...
9
votes
2answers
7k views

Figuring when the minute and hour hand coincide on a clock

I would like to list all possible times in a 12-hour period, where the hour hand overlaps the minute hand completely. This is really a question about three distinct things - to be done in Mathematica ...
10
votes
2answers
166 views

How can I set a fixed cell height?

I did this often in previous versions of the Mathematica notebook front end. I would have a cell with lots of raw data, e.g. a very long list. The list might go on for pages. I would set the cell ...
13
votes
3answers
451 views

Undocumented syntax of FilledCurve [duplicate]

Possible Duplicate: Undocumented form for FilledCurve[] A nice trick to get the outline paths of letters is to use the PDF exporter/importer ...
93
votes
7answers
3k views

What are the use cases for different scoping constructs?

Mathematica includes three functions that I know of which can be used to effectively (if not actually) define a variable and give it a value within a local scope: ...

15 30 50 per page