Questions on writing non-trivial programs in Mathematica. Do not use this tag for questions on plotting/graphics or for questions on doing mathematics with Mathematica, where the focus is more on the math than the program.

learn more… | top users | synonyms

0
votes
0answers
35 views

Are local variables possible in Mathematica? [duplicate]

Does Mathematica support local variables? (local - in the sense of general programming) To be more precise, I would like to have a variable which exists only within a given block of code (possibly, ...
5
votes
1answer
99 views

Programming Mathematica in plaintext, i.e. no formatting, non-notebook

I'm new to Mathematica and I've just begun reading Paul Wellin's Programming in Mathematica. The book, like many other books and online tutorials, revolves around using the notebook, with all its ...
0
votes
0answers
11 views

Nontransitive dice [migrated]

Here is an introduction to nontransitive dice. Then the question is what is the maximum of $\xi$ for three player $A,B,C$ such that $$P(A>B)\geq \xi$$ $$P(B>C)\geq \xi$$ $$P(C>A)\geq ...
0
votes
0answers
46 views

Inversion algorithm for Laplace Domain

I'm trying to invert an equation in the Laplace domain using Stehfest algorithm. It works very fine, but since I'm trying to represent a sinusoidal behavior I need a different algorithm that makes use ...
0
votes
2answers
70 views

How to automatically put the part of a variable name after the first letter in symbolized subscripts?

So here is what I have thought: Use ToString and StringLength in order to get the number of characters in the variable name. If it is bigger than one, change variable name by putting everything but ...
6
votes
2answers
55 views

Consecutive Print to target same output Cell

Is it possible to conveniently direct the output of consecutive Print statements to the same output without actually accumulating the output in a temporary string/variable. This would be useful in ...
0
votes
0answers
50 views

Implementing a back button (in CDF)

I have a rather large notebook, which contains a lot of hyperlinks to different parts of the notebook. Is it possible to make a back button (maybe as a docked cell button?) so that when a reader ...
17
votes
2answers
478 views

when is f@g not the same as f[g]?

I have always thought that f@g will give the same result as f[g] in all cases, and it is just a matter of style which one to use ...
0
votes
1answer
91 views

A problem on generating convex hull

For example, I typed the following: ...
2
votes
2answers
100 views

Writing a function that returns a (usable) function

I am trying to create a function that returns Arnold's Cat Map of size n iterated k times. I can get something out of the Function command, but I can't figure out ...
12
votes
1answer
176 views

Underlying Algorithms for List Manipulation Functions

Does anyone know, or know of a link for the underlying algorithms used for list manipulation functions? Specifically: Union with and without the ...
2
votes
1answer
73 views

Are there functions or packages in Mathematica to generate subsets in lex order, colex, revlex, etc

I am looking for non-canonical sorts of lists. A function that would give: Sort[X,order_type] With order_type = Lex, Colex, Revlex, etc.
30
votes
3answers
663 views

Automatic e-mail/text message when a calculation has finished?

Sometimes Mathematica takes quite a while to finish calculations and it would be convenient to be able to move away from the computer while it is working. I was wondering if there is any "clever" hack ...
2
votes
0answers
80 views

Force Dispatch to generate dispatch tables

Dispatch creates hash tables only for lists of length larger than 3. Is there any way to force MMA to create hash tables even for lists of length smaller than 4? ...
2
votes
1answer
163 views

1 2 3 4 5 31
15 30 50 per page