Tag Info

Why should I avoid the For loop in Mathematica?

If you are new to Mathematica, and were directed to this post, first see if you can use Table to solve your problem. I have often told people, especially beginners,...
• 236k

Why should I avoid the For loop in Mathematica?

Illustration of the timings required to compute the squares i^2 from i=1 to i=10^n for ...
Accepted

Why it seems that there is no counterpart function as to multiplication, to Total as to addition?

In addition to the previous answer... I designed and implemented Total 17 years ago. Its first version was named ListSum. The ...
• 37.9k

Difference between HashTable datastructure and Association datastructure

Summary Important differences between Association and CreateDataStructure["HashTable"] include: associations are ...
• 69.1k

What are all the "magic" symbols in the Mathematica language?

uh oh, another "work in progress" answer from me that may never be finished. Unevaluated Robby Villegas, Working with Unevaluated Expressions: ...
• 272k

What is the use of FullForm in Mathematica?

Perhaps there are other uses, but I've primarily used FullForm to "see" what Mathematica "sees". This can be useful when you are trying to do replacements on ...
• 10.1k
Accepted

Row vectors and column vectors (Mathematica vs. MATLAB)

This is a limitation of MATLAB, as MATLAB is only able to work with matrices. It does not have true vectors. It cannot even represent a character array as a 1D array or a structure array as a single ...
• 236k

Unexpected behaviour from Table[]

This is just a long comment trying to shed light on where the problem may be coming from. Since version 10.2, the following is valid syntax: Table[x, 5] Before ...
• 236k

Learn Mathematica (Wolfram) Language in one day

I would recommend these two, in the order listed: Wolfram Language: Fast introduction for programmers Besides the generic edition, there are currently two special editions of this tutorial available ...
• 70.9k
Accepted

What's the difference between these 2 associations?

Preamble The real problem here seems somewhat deeper than what the (mostly correct) observations in comments indicate. In Mathematica, a number of objects, which are so-called raw objects (including ...
• 115k
Accepted

Around usage results

There's a subtlety here. When operating together multiple Arounds, the two uncertainties will be considered separate and independent (in the statistical sense). ...
• 236k
Accepted

• 399k
Accepted

Why use pure functions?

Think of it as a macro. It shortens up your code. It stops your namespace from being polluted with extra function definitions. In some cases it can be faster than defining an auxiliary function. I ...
• 36.4k

What are the most common pitfalls awaiting new users?

Fourier transforms do not return the expected result Many users know a particular definition of the Fourier transform. When Mathematica returns an unexpected result and users cannot comprehend what ...
Accepted

Using Sequence to delete a part of an expression

What happens to the list after we assign an element to Sequence[] The answers given so far already contain most of the pieces needed to explain this behavior, but I ...
• 115k
Accepted

PostScript-like drawing in Mathematica?

As J.M. notes in a comment, AnglePath allows paths to be specified in relative terms instead of absolute terms: ...
• 69.1k
Accepted

With a few functions to try, defined in differentfunctions, try this headF: ...
• 67.5k
Accepted

What is a function?

A function is really a mathematical idea. In Mathematica, we can represent, or denote, a function in a few ways. But Mathematica is really working with expressions. ...
• 30.4k

Is there a "precedence table" for the canonical Sort ordering?

So I think the docs are mostly clear, if hard to visualize. Here's my version of such a table: ...
• 47k
Accepted

Using the Wolfram Language in a Commercial Product

Preface I feel inclined to answer because I live in both of the worlds you are describing. For one, I work in science where it is more than typical to write software that has sophisticated algorithms ...
• 113k

Learn Mathematica (Wolfram) Language in one day

The Official Elementary Introduction is also very good to learn some basic stuff.
Accepted

Learn Mathematica (Wolfram) Language in one day

For learning what I consider "just the wolfram/mathematica language" I would proceed as follows and start at the very low-level basics: Learn what is meant by a symbolic expression: ...
• 5,739

Nest list with two functions

Update: I think that the cleanest way is to use ComposeList (as suggested by kglr), but with PadRight to generate ...
• 7,846

A clean way to conceptually extract Parts from a circular list

It turns out we can do all the required transformations using only Partition using the (undocumented) sixth argument to do arbitrary-post-processing: ...
• 399k
Accepted

Broken ValueQ function in Mma12.2?

The behavior of ValueQ has changed in version 12.2. In fact, you can provide a Method -> "Legacy" option to match ...
• 67.5k
Accepted

Is $2x$ documented?

From Your First Wolfram Language Calculations: 2x means 2*x. Examples of no-space multiplication from ...
• 239k
Accepted

Taking the product of a list of matrices

Dot@@data should do what you're looking for. It replaces the main Head, List, with ...
• 1,092

Learn Mathematica (Wolfram) Language in one day

Mathematica Programming: An Advanced Introduction by Leonid Shifrin is my personal favorite. It may not be a "24 hour" exercise, but it's a breezy and fairly comprehensive introduction to ...
• 1,086
Accepted

Can a symbol have both OwnValues and DownValues?

Yes, a symbol can have both own-values and down-values, but it is usually bad practice to give a symbol both. Further, the order in which they are created matters, but there are problems both ways. ...
• 108k