Questions tagged [debugging]

Questions about debugging techniques, using the built-in debugger, and/or the Wolfram Workbench debugger.

Filter by
Sorted by
Tagged with
0
votes
0answers
32 views

After execution of simple list manipulation every expression turns dark blue and nothing is defined - how to debug

This question is related to this one in the sense that it uses the code from there. What happens is best illustrated in the video here. When I run (* part 1 *) ...
5
votes
2answers
119 views

Is there a builtin function to turn selective Echos off?

Suppose I have a code block EchoOff[CompoundExpression[ ..., Echo[...,"echo 1",f], Echo[...,"echo 2",g], ... ]] Is there a function ...
0
votes
0answers
72 views

How to see/trace Manipulate steps?

I am relatively new in Wolfram Language. What I want to solve is tracing "manipulate" steps in one of the demonstration project example codes. In my particular example, there are nearly 20 user build ...
3
votes
0answers
84 views

Displaying outcome of Trace [duplicate]

Is there a better way to display Trace output? Parsing could be provided to separate blocks of the computation by an extra line. Trace produces a large chunk of unbroken output that I copy into a new ...
2
votes
2answers
116 views

Mathematica clears all definitions or crashes with the following code, can anyone reproduce the bug? [closed]

I am working on a simple code, however Mathematica crashes or clears all definitions each time I will try to do anything with matrix B. Even when I just print it ...
2
votes
1answer
38 views

How can I properly use Catch[] to prevent my program from quitting?

I am getting an error depicting an Uncaught Throw, with the accompanying code being returned: Hold[Throw[$Failed, CURLLink`Utilities`Exception]] I have managed ...
0
votes
0answers
22 views

Indeterminate values in a MultivariateTDistribution

I'm running a simulation and the following error message shows up: ...
0
votes
1answer
89 views

An example of symmetric, real entry matrix with non-real eigenvalues, according to Mathematica. Is this a bug?

The following matrix is symmetric and all entries are real, ...
0
votes
1answer
100 views
3
votes
1answer
89 views

How to trace value assigned to local variable(variables in Module)?

Bug introduced in v10.1 or earlier and persists through v11.3 CASE:4240757 Here is my code: ...
2
votes
0answers
62 views

Profiling - workarounds/fixes for unreliable RuntimeTools`Profile? Update added Clue

[MMA 11.0.1.0 Win 10 64-bit] I have tried using RuntimeTools`Profile manually and the most useful profile[] function provided by @Carl-Woll in this answer. Sadly, neither work reliably and the ...
0
votes
1answer
68 views

Plotting intermediate values of an argument in a recursive function

I've read through the documentation on tuning and debugging but feel like I am missing some important concepts. Many of the examples given presume the programmer is explicitly generating ranges of ...
3
votes
0answers
137 views

Profiling in Mathematica

This is meant as a broad question, because I couldn't find such a discussion on this topic (the questions I found are very old and basic, e.g. the most popular one only shows where to find Mathematica'...
12
votes
1answer
206 views

Profiling a package

I have some code that I want to profile to see how much time each step takes, for instance: ...
0
votes
0answers
81 views

Problem with small program: Error: “Charting Private pvar”

Im in the making of a smaller self-running application. I have made a small piece of the program as it has to look in the end. However, sometimes when i change some of the input for either "demand" or ...
0
votes
0answers
43 views

Define a new Front End Syntax for Function Argument Checking & Debugging

In this question I asked a basic question about how to check argument types such that there was useful output from the front end when calling functions. Based on elements of the nice answer by @j-m-is-...
3
votes
2answers
147 views

Debugging NDSolve to see numerical values at each time-step

I wish to debug my NDSolve function and this is my first time using the Mathematica debugger. I have read around and attempted various different ways of debugging but I cannot figure it out. I want to ...
3
votes
1answer
139 views

Force a function to report argument type mismatches

As a relative newcomer to Mathematica, I am still frequently caught out by coding errors that, at least by default, MMA does not indicate to the front end, in particular when I define a function and ...
4
votes
1answer
85 views

TracePrint does not work as in my book

I am using Mathematica 11.3 Here is an my execution of code from book "Essentials of Programming in Mathematica" (Fibonacci numbers): ...
8
votes
3answers
341 views

How to get frame around every function without any evaluation?

Is there a good universal method that allows the making of a frame around every function. In the output, functions should remain unchanged (no evaluation, or any other changes) and each function ...
1
vote
1answer
162 views

Working of MatchQ[] with Blank, BlankSequence, BlankNullSequence [closed]

This code: In[76]:= Trace[MatchQ[{1,2,3}, {_?NumberQ}]] gives: Out[76]= {MatchQ[{1,2,3},{_?NumberQ}],False} This code: ...
1
vote
0answers
37 views

How to run the newly created notebook “anonymously”?

How to test the autonomy of all calculations on .nb, i.e. run it so that it does not use existing variables from other .nb executables? And if it refers to a variable you did not create yourself to ...
3
votes
0answers
40 views

Getting a Stack Trace on parallel execution

I find debugging very difficult in Mathematica, perhaps because I am unfamiliar with the appropriate tools. Ideally, I would like a "break on error" like Matlab with step control, however for the ...
0
votes
2answers
70 views

Why do I get a Partition::pdep error?

I've been running an iterative job (j=1,2.,3,.....300,000,000). The vast majority of steps proceed smoothly. Every several million or so steps, I get a "General::inf: Input matrix contains an infinite ...
1
vote
2answers
180 views

ImageAlign keeps breaking down

I have posted the same question on the community (http://community.wolfram.com/groups/-/m/t/1394441?p_p_auth=YV2a4wzw). I tried to register the movie posted below (compressed version here) using ...
0
votes
1answer
54 views

Problem in plotting the equation [closed]

...
36
votes
3answers
1k views

Interrogating a running evaluation

Is it possible to find the values of variables of a running Mathematica evaluation, without interrupting it? For example, suppose I do: Do[Pause[1]; a++, {50}] ...
6
votes
1answer
44 views

Trace and TracePrint are slow, How to Trace to a file for speed

Trace and TracePrint generates or prints a list of all expressions used in the evaluation of its argument. For complicated ...
7
votes
0answers
133 views

A bug in Derivative?

Update This is a bug in v11.3 or earlier and is fixed in v12. Original Post Check this out: ...
0
votes
1answer
79 views

Want help with debugging a For-loop

I'm trying to run a simulation, which at the end gives a value 'qber'. Now I want to run this simulation multiple times with different values of 'p' each time. And these value of 'p' are actually the ...
3
votes
1answer
221 views

Bug: Wrong limit in Mathematica 11.1.1 and current WolframAlpha

Bug introduced around 11.1.1 and fixed in 11.2 ...
2
votes
1answer
102 views

Problem in defining a function inside a module

I have a problem in defining a function in a module. I looked at Mathematica help and followed the same procedure. ...
1
vote
1answer
83 views

Why is ListLinePlot outputting weird graph

s = Import["Directory/FileName.xlsx"] ListLinePlot[s[[1]], AxesLabel -> {"Time", "Voltage"}] The graph is some sine wave but it outputs a huge number of lines ...
0
votes
1answer
62 views

Compilable table of Matrix diagonals function

1, I am trying to make Compilable function which takes Matrix of zeroes and ones f.e: ...
4
votes
1answer
101 views

Notification if new output differs from old

I'm developing a package and keep a notebook of test cases to make sure a fix in one function doesn't break anything else. Right now, when I make a change to the package, I run the relevant parts of ...
3
votes
1answer
78 views

Detecting transformation rules and removing them

Is it possible to detect the non-standard transformation rules (DownValues, UpValues, etc) that activate in an evaluation (and ...
4
votes
1answer
322 views

A more appropriate way to use RuntimeTools`Profile

There's a powerful tool call RuntimeTools`Profile, but it's hard to use. I must turn on Debug mode, then use ...
5
votes
0answers
100 views

Techniques in debugging with preview of possibly large expressions + garbage collection issues

First of all, all appreciate all suggestions how to rephrase the title to make it more friendly. Here's the background: Let's say your top level procedure flow is complicated, involves url calls, ...
5
votes
3answers
173 views

Is it possible to trace MorphologicalTransform?

Is there a way to see the arguments supplied to a function specified as second argument of MorphologicalTransform? An approach with ...
12
votes
1answer
412 views

Easy printing of executable code

I'm working on a package that has functions that call other existing and packaged functions. I'd like a way to output what some of those key calls are, so users can see what's happening under the ...
2
votes
1answer
155 views

Print[] to console in Mathematica 11 [duplicate]

The Edit-> Preferences -> Evaluation menu is gone from Mathematica 11. But I want to redirect the output of Print with the option that used to be called Print[] ...
1
vote
1answer
137 views

Debugging parallelized code

Is it possible to add a stack trace for this parallelized code to see where the problems stem from? ...
4
votes
0answers
47 views

Strange behavior of symbol::messageName in debugger [duplicate]

According to the documentation, there are two ways to define a message, which I implement as: ...
0
votes
0answers
33 views

Looking for the equivalent of C's __LINE__, etc

Some languages provide maintainable ways to specify the number of "the current line". In C, for example, one can use the __LINE__ macro. Does Mathematica have ...
6
votes
3answers
343 views

Avoiding the suppression of messages by NIntegrate

Consider the following code: test[x_] := If[1 < x < 2, Message[Test::message]; x^2, x]; NIntegrate[test[x], {x, 0, 3}] 5.33333333333334 I.e. it gives me ...
0
votes
1answer
74 views

Using Dialog inside a function to debug

I need to understand why my functions doesn't work. Thus, I have put a Dialog at the beginning of it : ...
1
vote
1answer
127 views

How to write command in debug mode?

I need to debug a function, and to do it I would like to display variables, do few computations etc while I am at a breakpoint. But I don't see where I could do that ? I have the stack window opened ...
2
votes
0answers
84 views

Piecewise function Syntax error only in debug mode

If I enter the following through mathematica (11.0) through UI $$\begin{cases} 1 &x \geq 0 \\ 0 &True \end{cases}$$ No error is reported. $$\begin{cases} 1 &x \geq 0 \\ 0 &True \end{...
1
vote
1answer
47 views

If clause gives back 2 different result [closed]

I am writing a simple if clause, but keep getting wrong answers, so I ended up writing 2 almost the same if clauses, one giving back correct answer, and the other giving back wrong answer. Can't ...
13
votes
4answers
781 views

How to make a custom Echo

I usually check my intermediate variable by Echo.Like Table[Echo@x, {x, 10}] But when the intermediate variable have too much ...