For questions on interpreting existing error messages that you have encountered, as well as writing and managing messages, assertions and checks for your own functions.

learn more… | top users | synonyms

44
votes
2answers
1k views

What are the best practices / most common / idiomatic ways to report errors in Mathematica?

In particular, what are the best ways to report errors about incorrect arguments to a function? Checking for the correct arguments is relatively easy using patterns, but how to report an informative ...
38
votes
2answers
1k views

Mathematica Debuggability

One of the things that I really dislike about Mathematica is its lack of debuggability compared to many other programming languages. Some of the problems arises from the functional nature of ...
28
votes
3answers
801 views

No warning when extrapolating with Plot

One of the most annoying "features" of Mathematica is that the Plot family does extrapolation on InterpolatingFunctions without ...
24
votes
1answer
417 views

which is better, using Assert[] or manual checks on arguments and other computations?

I never used Asserts in Mathematica, but trying to see what advantage they have over just argument check and additional definitions of the function to capture unwanted input. For example, which one ...
19
votes
4answers
2k views

Why does MatrixForm affect calculations?

This is a really newbie question, but it has me confused. Why does this code work without // MatrixForm and doesn't work with ...
16
votes
3answers
911 views

What is an “INTERNAL SELF-TEST ERROR”?

I got this all the time after updating to 9.0 (OS 10.8.2): That's Clipboard|c|3015 for the benefit of anyone searching. The error went away with 9.0.1, but a version has reappeared (multiple times ...
15
votes
2answers
284 views

MathKernel doesn't return all Messages

In Mathematica I run this command: Plot[Sin[x], {x, 1, 15}, GridLines -> error] It generates a Plot with this error message: A GridLines specification ...
15
votes
1answer
369 views

Quiet doesn't work with FindRoot when using Brent method

The following has no solution: FindRoot[x == 1, {x, 0.25, 0, 0.5}] And Mathematica correctly warns us: FindRoot::reged: The point {0.5} is at the edge of the ...
14
votes
2answers
2k views

Importing a large Excel file

I'm trying to import a simple Excel file containing 94,000 rows and 52 columns of various types, mostly Reals. It's a 38-MB file. I get this super helpful error ...
12
votes
4answers
271 views

How to catch complete error message information

If I evaluate this expression: Module[{}, 1/0;0^0]; msg = $MessageList I get: ...
12
votes
1answer
538 views

Finding a Specific Line in a Package

In a package I am developing, I accidentally left this line Protect[ uncompleted prior to running the package. Mathematica produced this error message ...
11
votes
2answers
507 views

Take screenshot of the entire desktop using Mathematica

Is it possible to get a screenshot of the entire desktop directly in Mathematica? I am on Ubuntu running Mathematica 8. For some reason GUIScreenShot[] fails. But ...
11
votes
1answer
277 views

Check does not interrupt evaluation of the expression when a Message is emitted

On the surface, Check looks like a good method to use when you need to abort the evaluation of an expression whenever a Message ...
10
votes
4answers
2k views

What is the cleanest way to prevent divide-by-zero warnings?

If I evaluate {1, 2, 3, 4}/{5, 6, 0, 8}, obviously I get one warning: ...
9
votes
3answers
2k views

General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it?

I was just evaluating a couple of expressions and started to get errors like this: ...
9
votes
2answers
1k views

Why is this semicolon in red?

I have a piece of code that works well, but when I put a semicolon after a plotting statement, the semicolon appears in red. What's the error?
9
votes
4answers
529 views

Using Position (which requires a pattern) in the same manner as Select (which requires a criterion)

I am using Mathematica7. I have a list of lists (creatively named list in the following sample code) containing data. I would like to find the positions of the ...
9
votes
2answers
313 views

Symbolic integration fails while numerical integration succeeds

I am hoping to evaluate the following integral Integrate[((r^3 - 7)^(2/3)*(1 - (r^3 - 7)^(2/3)/r^2))/r^3, {r, 2, Infinity}] but Mathematica informs me that this ...
9
votes
2answers
459 views

Solving/Reducing equations in $\mathbb{Z}/p\mathbb{Z}$

I was trying to find all the numbers $n$ for which $2^n=n\mod 10^k$ using Mathematica. My first try: Reduce[2^n == n, n, Modulus -> 100] However, I receive ...
9
votes
2answers
257 views

How to find a specific error message?

Is there a way to find an existing error message in the System` context, that is used for a certain case? I want to include a message in a custom function that ...
9
votes
1answer
171 views

StringMatchQ and Alternatives throws message in init.m

The report of this issue, which itself relates to code of my answer here, exposed a behavior I cannot explain. If I use StringMatchQ in combination with ...
9
votes
0answers
87 views

How to capture implicit fails in Plot or Show? [duplicate]

How can I make a construct similar to C++ functions: try{} catch{} I want to use it to avoid showing a lot of errors in the plot area when for example one of the ...
8
votes
2answers
898 views

What do I do when I get an “Iterator does not have appropriate bounds” error?

I used this as input Table[600851475143/i , {i, 1, 600851475143}] but got an error ...
8
votes
2answers
680 views

Table function with Part[] call misbehaving, but only after initial startup of Mathematica

I am getting errors like: Part::partd: Part specification standardBasis[[1]] is longer than depth of object. with the following Manipulate expression: ...
7
votes
1answer
227 views

Why is Dataset upset by division by zero?

Consider this example: ds = Dataset@Transpose[<|"a" -> {1, 2, 3, 4, 3, 2, 1}, "b" -> {6, 5, 4, 3, 2, 1, 0}|>, AllowedHeads -> All] Now say I ...
7
votes
2answers
257 views

Adding a constant vector to a vector differential equation seems to break NDSolve. Why?

I'm trying to solve a differential equation that's phrased in terms of matrices and vectors. My minimum working example is this: ...
7
votes
1answer
124 views

What should I call the messages that appear when the mouse moves over failed graphics output?

I attempted to evaluate the following Plot[x^2, {x, 1, 2}, PlotStyle -> {RGBColor[a]}] which, of course, failed. After the failure, putting my mouse over the ...
6
votes
2answers
218 views

Using Read for calling external command does not release file handle

The standard and robust method for piping to/from external commands under Windows is to create a temporary file, save the input into it, pipe it to the command and save its output to a second file. ...
6
votes
2answers
439 views

How do I make NotebookEvaluate work inside Button?

The following creates a button to select a notebook to run. When the button is pressed it seems that Mathematica finds the notebook but cannot evaluate it. The following error occurs Could not ...
6
votes
1answer
99 views

What is the simplest way to determine which call to a superfunction has generated a Message?

I have a complicated function which contains many calls to NIntegrate, NSolve, FindRoot and ...
6
votes
1answer
90 views

Error when putting ??symbol in a cell with another expression

Putting ??symbol in a cell and another expression in a different row of the cell returns the following error: ??symbol 1 + 2 ...
6
votes
1answer
332 views

What does MaxStepFraction do?

I find that with NDSolve[...] while solving a partial differential equation, changing the MaxStepFraction from ...
6
votes
1answer
310 views

Mathematica Opens Each Session With Beep

First off, I am using Mathematica 8.0 and Mac OS X 10.7.4. Recently, when starting a new Mathematica session, I am confronted with an error beep and message window stating "The file you tried to open ...
6
votes
1answer
123 views

Is it possible to disable assumptions used by FullSimplify for zero testing [closed]

Sometimes when I invoke FullSimplify on a large expression, I get a series of messages like this: ...
5
votes
2answers
1k views

Error (NSolve::ifun) when using NSolve, I need help interpreting the error

I wrote the following code to observe how the solutions to the equation $(e^{i a})^2 = e^{i b}$ varied as $b$ varied between 0 and $2\pi$ ...
5
votes
3answers
321 views

ComplexInfinity/Indeterminate error when evaluating derivative

Motivation: I want to find the coefficients for the polynomial that is obtained when one adds together the first $n$ natural numbers to the power of $a$; that is, when you consider $1^{a} + 2^{a} + ...
5
votes
1answer
1k views

FeynArts not working properly

So I have installed all FeynArts folders (from 3.5 to 3.7) with FeynCalc 8.0.1., and none of it is working properly :\ First I load the path to specific FeynArts package (3.5 for instance), then, by: ...
5
votes
2answers
156 views

“Not a valid Filling specification” error

I have a function, which plots the given function array f. This is a part of the function: ...
5
votes
1answer
104 views

Strange Tilt on error notification

I was testing the source code of the answers to this question. And when I tried this response and maxed out most of the manipulators, this is what I got. What went wrong that the errors are ...
5
votes
2answers
169 views

How to switch off all messages?

How can I want to switch off all messages in a Mathematica session? Quiet[expr] allows me to evaluate expr without messages. ...
5
votes
1answer
178 views

What's wrong with this code to create a matrix?

Here is my code: ...
5
votes
1answer
220 views

How to switch off messages on all kernels?

I am using ParallelMap for my code,however, it gives some messages that don't affect the evaluation process but fill up the memory and take some more time. So, I ...
5
votes
2answers
73 views

Automatically detect largest interval over which NDSolve can find a solution

Question: Consider the following numerical resolution: NDSolve[eqn, {x1[t], x2[t], y[t]}, {t, tmin, tmax} where eqn, ...
5
votes
1answer
2k views

How do I prevent NIntegrate::inumr errors within other functions?

I believe this question is best illustrated with a simple example. If I run FunctionInterpolation[NIntegrate[a + b, {a, 0, 1}], {b, 0, 1}] I get errors of the ...
4
votes
2answers
213 views

Indeterminate expression. Where?

Consider the following: ...
4
votes
3answers
93 views

Passing a variable messages list to Quiet

I'm trying to build a Verbose option into some code but I'm having trouble passing to a Quiet statement a variable list of which messages I want to suppress. My ...
4
votes
1answer
86 views

Issues with $MachineEpsilon

I'm attempting to add $MachineEpsilon to numbers I am pulling from the domains of 3 interpolating functions. I pulled 3 numbers, and for one of these numbers adding ...
4
votes
1answer
215 views

CreateCOMObject doesn't work on home edition

I can call an application named "PinPoint.Plate" with Visual Basic, Python and Mathematica version 8 but not with version 9. I can still call Excel though. How can I fix this? This is what I did: ...
4
votes
1answer
114 views

How can I prevent a Plot expression from evaluating points forbidden by its RegionFunction?

I just ran into this and it had me scratching my head for a good while. Say I have a function which may produce error messages for certain inputs, like e.g. ...
4
votes
1answer
335 views

Differential Equations with Matrices

I'm trying to implement the differential equation of a Cellular Neural Network in Mathematica as seen below: ...