# Tagged Questions

Questions on the basic structure of the Mathematica language (Wolfram language) including atomic data types, syntax etc

55k views

### What are the most common pitfalls awaiting new users?

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...
2k views

### Scan vs. Map vs. Apply

I cannot understand the difference between Apply, Scan, and Map. I have tried to play with ...
601 views

### What are the requirements for a well behaved indexed variable? Subscript, ToExpression, Downvalue?

On writing this answer I needed to call a function, (NonlinearModelFit) with an unknown number of parameters. We have learned that we should not use ...
641 views

### Shorter syntax for Fold and FoldList?

I find it tedious to write out the following: a = {1, 2, 3, 4}; Fold[f, First @ a, Rest @ a] f[f[f[1, 2], 3], 4] It ...
6k views

### How to make use of Associations?

I have been curious about it for long. Now that Mathematica 10 arrives, I think it's time to ask the question: How the new Association data structure would be used ...
1k views

### Incompatible Changes since Mathematica Version 7?

There is documentation of the incompatible changes made to Mathematica with each major release: Incompatible Changes since Mathematica Version 1 Unfortunately that documentation simply stopped ...
1k views

### Why is the new PositionIndex horribly slow?

This issue has largely been mitigated in 10.0.1. New timings for the final test below are: ...
476 views

### What does None mean in a control specification for Manipulate?

I am now struggling to understand code that contains the following (simplified) Manipulate structure. ...
13k views

### What does # mean in Mathematica?

I asked Mathematica to compute the following Solve[c (1-x)^2-x^(1/4) == 0, x] and it returned this: x = Root[#1^8 c^4 - 8 #1^7 c^4 + 28 #1^6 c^4 - 56 #1^5 c^...
1k views

### Behavior of expression evaluation in Plot

I'm confused with Mathematica's way of parsing expressions. I've been struggling with this for a while and never found an exhaustive answer, sometimes things don't parse the way I think they would ...
2k views

### How to completely delete the head of a function expression

Is there any way to completely remove the head of an expression function? For example, how would I remove the head Cos from ...
632 views

### Why is Query so much slower than Part?

Time for another of these(1),(2) as yet another new-in-10 function appears to have poor performance compared to older alternatives. This time: Query appears to be ...
5k views

### Is Mathematica an Implementation of the Wolfram Language?

I am trying to figure out what the announcement of the Wolfram Language means for Mathematica. Is Mathematica an implementation of the Wolfram Language, or is it something else?
944 views

### Is there a name for #1@#2&?

Why does the pure function # @ #2 & have no name? I'm asking because sometimes I find inelegant to write expressions like ...
551 views

### I define a variable as local to a module BUT then the module uses its global value! Why?

I have a question about modules and local variables. Here's my example: h = 5; Module[{a, h}, a[h_]= h^2; a[4]] (*Out[2] = 25*) I expected the module to ...
400 views

### Make mathematica treat $e_i^2$ as numeric

With NumericQ[symbol] = True, I can declare that a symbol is numeric. I want the expressions matching: $$e_{\text{i\_}?\text{IntegerQ}}^2$$ to be treated as ...
2k views

### Is Mathematica comparable to C++ for creating standalone applications?

At my university, I have a yearly essay. I'm allowed to use any technology for implementing it. I've been coding it in C++ with Qt. I thought of about Wolfram Mathematica because I have some ...
463 views

### Can't get Append to append a record (association) to a dataset

The Documentation Center item, Computation with Structured Datasets, implies that Append has been extended in V10 to work with datasets. But not on my computer. (I ...
409 views

### How do I make a string literal without having to escape backslashes?

I'd like to say something like: foo = @"\abc\def\ghi" instead of foo = "\\abc\\def\\ghi" How do I do this? This would ...
348 views

### How to restore function attributes to default

Adding an attribute to a function is easy and clearing attribute is easy also. But I don't know really how to restore the attributes of a function to its defaults. All I do is quit the kernel or close ...
228 views

### Why can't a string be formed by head String?

Since everything is an expression in Mathematica, why must a string object be formed by "abc" but not by a String[abc] ...
183 views

### ControlType -> None Vs. Module inside Manipulate (i.e. making everything local)

I'm building a program on another one made available in the Wolfram Demonstration Project. I've noticed that in the original code (working flawlessly) many variables were made local inside the ...
142 views

### Can a Symbol own OwnValues that don't evaluate when it's the head of an expression?

I believe this a question that most of us have encountered when we were beginners but forgot when we got more familiar with Mathematica. We know the notation $y=y(x)$ for functions, where $y$ here ...
361 views

### What does f_[whoCalled]^:=f really mean?

I came across the following post by John Doty in this Google Groups discussion: On Friday, January 11, 2013 8:23:16 PM UTC-7, amzoti wrote: It is clear the Mathematica uses Lisp as one ...
376 views

### Is everything in Mathematica ultimately stored as a rule?

My current understanding about Mathematica is that everything, at the lowest level, ends up as replacement rules. First question: is this true? Second question: does Mathematica "gloss over" these ...
998 views

### Postfix Double Slash Notation with Multiple Parameters [duplicate]

Examples A convenient shorthand that I use frequently is the "double slash" notation to string commands together. For example, I can write: ...
407 views

### Treat all variables as local in a module [duplicate]

In most languages, any variable defined inside a function is considered local. ...
507 views

### Defining indefinitely many functions

Is it possible to define a class of indefinitely many functions f1, f2, f3, ... such that <...
282 views

### Why won't SparseArray let me store values with the head List?

When you attempt to define a SparseArray with elements that have the head List it complains: ...
240 views

### Signed power set of a list

Given {a, b, c, ...} with $n$ elements generate a list with $2^n$ elements. For example, if the list were {a, b, c}, then the ...
209 views

### How to assign symbols to functions

Several functions work with symbols in MMA: Take for example Part: l1=l2=Range[4]; l1[[3]] (*3*) l2[[4]] (*4*) I want to make ...
259 views

### How to construct a linear feedback shift register

Are there any posts regarding the construction of a LFSR (Linear Feedback Shift Register) in Mathematica? I can't seem to find any and I am not sure how I would construct one.
814 views

### What's the difference between Inactive and HoldForm?

In version 10, Mathematica not only added Inactive / Activate but also highlighted this change in the "New in 10" page (in Core ...
208 views

272 views

### How do I understand ListCorrelate(contains $\{k_L,k_R\}$) when it works for 2-dimentional data?

Two months ago, I asked a question here And @nikie give me a solution: The intuitive way to understand ListCorrelate is that the kernel is "moved" to every ...
776 views

### Real Numbers in the Wolfram Language

Epilog: Much of the discussion in the answers below revolves around the distinction between Real as a data type and real numbers as a domain or class of numbers (irrespective of the form in which ...
439 views

### Why some built-in functions are slow

I just wonder why some built-in functions are slower compared to some other ways using more than one built-in functions for doing same job. consider this example: ...
197 views

### A bug in the overloading of MemberQ and FreeQ for Association?

Bug introduced in 10.0.0 and fixed in 10.1.0. While answering Pattern match for nested Association I came across behavior of MemberQ and ...
156 views

Usually h @@@ {f[1, 2], f[3, 4]} === {h[1, 2], h[3, 4]} but this is not the case when f is ...
314 views

### Wolfram Language symbols by their Ranks

I'd like to get the top 50, the bottom 50 and an ordered list of all Wolfram Language symbols based on their "Ranks". With ...
272 views

### Overlapping pure functions

Let say I need and option for Plot: RegionFunction -> (-6 < #2 < 6 &) But I also want those ...
423 views

### When must I use the Return function?

In a comment to my answer to this question, QuantumDot asks, "Where can I find more information on when I must use the 'Return' function?". I found this too deep a question to be answered by leaving a ...
220 views

### How to Override the Head of a Symbol

I was wondering if it is possible to override the head of symbols/operators. As a motivating example if I run: Then Ket will be returned. But lets say I want Bob to be returned instead of Ket. Is ...
179 views

### Is there a way to control which special forms Normal converts?

Normal documentation reads: Normal[expr] converts expr to a normal expression, from a variety of special forms. But is there a way to control which special ...
411 views

### How to visualize pattern matching process?

I want a function that does the same job like ReplaceRepeated, and can make the matching process visible. I searched the Internet but didn't find any existing code ...
165 views

### DSolve—different solutions for same set of equations using different symbols?

I happen to find that DSolve can give different solutions, even a different number of solutions, for a set of differential equations just by making a change in the ...
342 views

### Find a word's linguistic pronunciation

Is there a way to get a word's linguistic pronunciation given the word as a string? I would like a function LingusticPronunciation such that, for example, ...
56 views

### What has changed in pattern matching functions with the Orderless attribute?

In making an attempt to answer this question, we ran into a version-dependent pattern-matching issue. An extended discussion in the comments transpired, and some inconsistencies arose. Consider the ...