Questions tagged [wolfram-mathematica]

Wolfram Mathematica is a computer algebra system and programming language from Wolfram Research. Mathematica has its own Stack Exchange site at https://mathematica.stackexchange.com/ and that site is the preferred place to ask questions about it.

Wolfram Mathematica is a computer algebra system and programming language from Wolfram Research. The programming language is a term-rewriting functional programming language strongly influenced by . Not to be confused with mathematics ().

Mathematica has its own Stack Exchange site. That is the preferred site for asking questions on this topic.

Tips for asking Mathematica questions

  • Include self-contained source code or a link to a notebook that illustrates the issue
  • Include relevant image, for a graphics related question

A chat room for the tag is available here. It is intended for discussion of some meta-related problems and perhaps some social activity.

Free Mathematica Programming Book


Don't forget to check out our little Tool Bag and add your favorite tricks there.

4457 questions
16
votes
2 answers

Testing for Null and not Null in Mathematica

What is the best / cleanest / advisable way to test if a value is Null in Mathematica ? And Not Null? For example: a = Null b = 0; f[n_] := If[n == Null, 1, 2] f[a] f[b] has the result: 1 If[0 == Null, 1, 2] Where I would have expected…
nilo de roock
  • 4,077
  • 4
  • 34
  • 62
16
votes
2 answers

how to generate such an image in Mathematica

I am thinking of process an image to generate in Mathematica given its powerful image processing capabilities. Could anyone give some idea as to how to do this? Thanks a lot.
Qiang Li
  • 10,593
  • 21
  • 77
  • 148
16
votes
2 answers

How to generate animated GIF of a Manipulate? 8.0.1

Exporting to animated gif seems to have changed in Mathematica 8.0.1? I normally make animated GIFs of a manipulate by simply writing: v=Manipulate[....] then Export["foo.gif",v]; But now it does not work. I just get one static image. Here is an…
Nasser
  • 12,849
  • 6
  • 52
  • 104
16
votes
1 answer

Why do I have to evaluate this twice?

I cannot figure out why I have to evaluate this twice (in Mathematica 7) for the assignment to take. First evaluation: Unprotect[Rule]; Attributes[Rule] pp = Plot | LogLinearPlot | ListPlot | ParametricPlot3D; (h : pp)[True -> False] ^:=…
Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
16
votes
3 answers

How to show plots inside a loop in mathematica

I am wondering if you have good ways to show plots inside a loop in mma. Usually, the output of Plot function is not shown, for example in the following code: For[i = 1, i <= 10, i++, Plot[Sin[i*x], {x, -Pi, Pi}]] Thanks for your help. Edit In…
Qiang Li
  • 10,593
  • 21
  • 77
  • 148
16
votes
1 answer

exporting expressions to C, part 1 [wolfram-mathematica]

I have several expressions I have generated in Mathematica that I would like to export into the source code of an external C program. "CForm" almost does what I want except that exponentiation is expressed as calls to Power(). My expressions…
Daniel Chisholm
  • 566
  • 5
  • 16
16
votes
5 answers

Mathematica: How to apply function to a certain column of a table

I would like to apply a function to a specific column of a table. Say to the i-th column of a (m x n) table. Actually I just want to multiply all elements in that column with a scalar, but the application of a general function would be fine as…
janitor048
  • 2,045
  • 9
  • 23
  • 29
16
votes
4 answers

What does # mean in Mathematica?

Does anyone know What # in for example Root[-1 - 2 #1 - #1^2 + 2 #1^3 + #1^4 &, 1] means in Mathematica? Then what does Root[-1 - 2 #1 - #1^2 + 2 #1^3 + #1^4 &, 1] exactly mean? Thanks.
user376089
  • 1,245
  • 3
  • 14
  • 18
16
votes
5 answers

Partition Equivalent in Julia

What is an equivalent for Mathematica's Partition function in Julia? Mathematica's Partition[list,n] takes an array and partitions it into non-overlapping sub-list of length n. On the other hand, the partition function in Julia takes an array and…
Ali
  • 503
  • 6
  • 20
16
votes
3 answers

Way to deal with large data files in Wolfram Mathematica

I wonder if there exists way to work with large files in Mathematica ? Currently I have a file about 500Mb with table data. Import["data.txt","Table"]; What is alternate way?
Igor Konoplyanko
  • 9,176
  • 6
  • 57
  • 100
16
votes
2 answers

The semantics of Mathematica's Thread function, someone needs to finally put this to rest

Wolfram Research has had the same documentation for this function for the last 8 years at least: Thread[f[args]] "threads" f over any lists that appear in args. A lovely circular definition if I've ever seen one. Does anyone know what the actual…
cons
  • 14,423
  • 4
  • 20
  • 14
16
votes
3 answers

In Mathematica, what does @@@ mean?

I've been working through problems on Project Euler, and some of the solutions that other people have posted use a triple-at-sign, i.e. '@@@'. In the help browser for v7, I find an entry for @@ (which says it's the infix version of 'Apply') but…
Eric
  • 11,392
  • 13
  • 57
  • 100
15
votes
3 answers

What is the recommended way to check that a list is a list of numbers in argument of a function?

I've been looking at the ways to check arguments of functions. I noticed that MatrixQ takes 2 arguments, the second is a test to apply to each element. But ListQ only takes one argument. (also for some reason, ?ListQ does not have a help page, like…
Nasser
  • 12,849
  • 6
  • 52
  • 104
15
votes
4 answers

Import data from URL

The St. Louis Federal Reserve Bank has a great set of data available on a variety of their web pages, such…
Jagra
  • 3,149
  • 1
  • 18
  • 19
15
votes
4 answers

How do I export a higher resolution image of a Mathematica Graph object?

How do I export a re-sized version of the output I get from a call to GraphPlot (or TreePlot if they produce different output) to a jpg file? Currently, I'm simply calling Export[file_name, G] where G is the result from a call to something like…
David Perlaza
  • 580
  • 2
  • 5
  • 9