All Questions

67 votes
4 answers
6k views

How do I evaluate only one step of an expression?

I am looking for a simple, robust way to evaluate an expression only one step, and return the result in a held form. The definition of a single step is ambiguous, and this itself is probably worthy ...
Mr.Wizard's user avatar
  • 272k
18 votes
1 answer
4k views

Combined numerical minimization and maximization

I want to numerically calculate the maximum of a function defined by the minimization of another function, like the following: ...
celtschk's user avatar
  • 19.2k
25 votes
5 answers
1k views

How can I work out which functions work with SetOptions?

Not all functions seem to work with SetOptions. e.g. ...
Mike Honeychurch's user avatar
3 votes
2 answers
542 views

what is the command to make Mathematica beep each time there is an error even for the same command?

sorry for a basic question, but does any one know what is the trick to make the front end beep at me each time I issue the same command (which contain an error)? It now only beeps the first time, ...
Nasser's user avatar
  • 147k
18 votes
7 answers
1k views

Elegantly pairing up mismatched lists

HistogramList returns a list of bin boundaries and a list of counts. There is one more boundary than counts, and I'd like to pair them up so I can feed it into <...
Brett Champion's user avatar
4 votes
3 answers
1k views

Drawing graphics part by part

What I want to do is to draw graphics part by part, because I made a function that generates coordinates according to which I will draw graphics. The problem is that MMA does not operate as I expected....
balboa's user avatar
  • 683
16 votes
2 answers
2k views

Constructing functions with variable number of output arguments

In Mathematica, you can construct a function f to have different definitions based on its input arguments. For example, ...
rm -rf's user avatar
  • 89.1k
36 votes
4 answers
3k views

How to collect result continuously (interruptible calculation) when running parallel calculations?

This is the most common pattern to compute a table of results: Table[function[p], {p, parameters}] (regardless of how it's implemented, it could be a ...
Szabolcs's user avatar
  • 236k
18 votes
4 answers
2k views

Strategies for avoiding and handling shadowing

When dealing with namespaces in Mathematica (BeginPackage, $ContextPath ...) one is unavoidably confronted with the problem of ...
Albert Retey's user avatar
  • 23.6k
16 votes
2 answers
381 views

How do you determine the optimal autocompilation length on your system

When you pack lists there is an overhead therefore packing a list with, say, 2 elements is likely to cost more than you get back in efficiency. Mathematica has default list lengths for which functions ...
Mike Honeychurch's user avatar
23 votes
2 answers
758 views

SetAttributes[f,Flat]: Why the order dependence?

I'm experiencing a strange phenomenon. Here's a (quite artificial) test case: The following definition work just fine: ...
celtschk's user avatar
  • 19.2k
33 votes
0 answers
3k views

Custom package development: Basic steps [duplicate]

Every once in a while, I write a generic function that I use quite often for months to come. However, package development in Mathematica is not very well documented from what I can tell, and I was not ...
David's user avatar
  • 15k
16 votes
2 answers
5k views

How to represent and manipulate abstract indexed vector (or tensor) expressions?

I have a couple abstract indexed quantities, both differential elements $dx = dx^\mu e_\mu + x^\mu de_\mu$ $du = du^\mu e_\mu + u^\mu de_\mu$ I can compute the expression $(dx + du) \cdot (dx + du) ...
Peeter Joot's user avatar
  • 6,438
35 votes
3 answers
13k views

How to export large graphics?

I'm using Raster to create large graphics (1000 by 1666), which I want to Export as a JPEG or TIFF in a resolution that can be printed in a large size, 3' by 5'. I'...
stopple's user avatar
  • 1,161
35 votes
2 answers
2k views

What are recommended guidelines for developing packages?

This might be of general interest – I have different questions regarding naming conventions, contexts, subcontexts, shadowing, etc., but I do feel that they are closely related, thus I don't really ...
István Zachar's user avatar

15 30 50 per page