The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
1answer
70 views

Changing the definition of N: unexpected $RecursionLimit::reclim error

I have some objects represented as follows: Object[data, param] data is a list of numbers, ...
0
votes
0answers
37 views

Why First (or Last) and Take are distinct functions? [on hold]

I think it would be better to make First take an optional second argument, so that First[list,n] is identical to ...
15
votes
0answers
114 views

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

Bug introduced in 10.0.0 While answering Pattern match for nested Association I came across behavior of MemberQ and FreeQ in ...
60
votes
3answers
2k 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 ...
4
votes
1answer
33 views

How to find out which definitions use Temporary symbol?

According to the Documentation, Symbols with attribute Temporary are automatically removed when they are no longer needed. For example: ...
12
votes
3answers
176 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 ...
1
vote
0answers
63 views

Concise way to express Table[FactorInteger[300][[n, 2]], {n, 1, Length @ FactorInteger[300]}]

I can get the exponent part of FactorInteger[300] with Table[FactorInteger[300][[n, 2]], {n, 1, Length @ FactorInteger[300]}] ...
34
votes
4answers
529 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 ...
8
votes
1answer
154 views

Why some built-in functions are slower compared to some other ways using more than one built-in functions for doing same job

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: ...
3
votes
2answers
93 views

MapThread problem

I would like to do the following: ...
2
votes
0answers
55 views

Unexpected behavior from Indexed

I was going to include Indexed in this answer, thinking that it operated much as a List-only ...
0
votes
1answer
52 views

What does this Append expression do? [closed]

I have to understand some code. A part of it is written below. Can someone explain to me what it does: ...
9
votes
6answers
358 views

Product of elements of a list

Sum is for functions; Total is for a list. Product is for a function; what is the command ...
8
votes
2answers
106 views

DownValue assignment using Apply

Why does assigning a DownValue using Apply, e.g., ...
2
votes
0answers
26 views

How exactly does ReplaceAll work? [duplicate]

I am not sure if this question has been asked before but anyway, Consider these two examples: ...
5
votes
4answers
180 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 ...
0
votes
0answers
75 views

Solution of a set of quadratic congruences (Chinese remainder)

Edit: Please remove this question. I think there are mathematics error in what I am asking. You are welcome to edit the question if you can state the problem correctly. I have a set of quadratic ...
2
votes
1answer
222 views

Dynamic graph construction and visualization (Watts' “Small Worlds” α-model)

I need some help in creating a Mathematica program for building and visualizing Watts' "Small Worlds" α-model. This is a variant of the more known (and much more simple) β-model (also known as ...
4
votes
2answers
134 views

Non sequitur in documentation of MemberQ

Mr.Wizard's question about MemberQ and FreeQ got me to re-read the documentation for those functions. I find I don't understand ...
0
votes
1answer
47 views

Association of pure functions [duplicate]

I've encountered confusing behavior of Association when I try to use it for storing pure functions. For example: as = <|"1" -> # + 1 &|> ...
9
votes
5answers
284 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: ...
33
votes
1answer
657 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 ...
10
votes
2answers
175 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 ...
3
votes
1answer
214 views

How to use Mathematica for traditional programming

I am new to the structure of Mathematica. I understand that in the notebooks, one enters the symbolic expressions and evaluates them. But I need to generate some simulated data and do that a few ...
34
votes
2answers
749 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: ...
7
votes
1answer
193 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] ...
2
votes
3answers
108 views

How to test for Indeterminate values?

I need something like this a = 101010/0; If[a == ComplexInfinity, True, False] But if I use ToString, I get what I want. ...
6
votes
1answer
79 views

Taking the derivative of a function with indexed variables

I have a number of functions that depend on a variable x. I am using a second, integer variable to index these functions, i.e. something like ...
1
vote
1answer
39 views

Strange behaviour of Set and Part when given a sequence

Consider this example: lis1 = {a, b, c}; lis1[[2]] = Sequence[e, f]; lis1 (*{a, e, f, c}*) lis1[[2]] (*e*) lis1[[2]] = Sequence[g, h]; lis1 (*{a, g, h, c}*) It ...
4
votes
1answer
74 views

How to define a formula in FormulaData?

I am looking for a way to manage frequently used formulas in my research, in a organized way in Mathematica. It appears to me that using FormulaData would be a ...
7
votes
6answers
395 views

How to build a list of functions

Having said that I'm no expert, I have some problems in generating a list of functions inside a loop. The functions in the list should depend on the elements of a parameters list, that are read in ...
10
votes
1answer
126 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: ...
1
vote
1answer
58 views

Why does WordData fail to find “PartsOfSpeech” when given a list of two words?

I have the following sample code. StringSplit["a test string", " "] Thread[WordData[%, "PartsOfSpeech"]] The output I get is: ...
4
votes
1answer
168 views

How to see abstract syntax tree of Wolfram Language expression

I mean, suppose I have this expression: 2 + 2 I want to get something like this: Plus[2, 2] as an output. I've tried FullForm, but this just evaluates 2+2 and returns 4. Is this even possible?
7
votes
2answers
287 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 ...
21
votes
2answers
454 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 ...
10
votes
0answers
282 views

Create a new infix operator [duplicate]

It is well known that the infix operator @@ is used as a short form of Apply. For example, both ...
6
votes
2answers
192 views

Why does Mathematica appear to change the head of certain expressions?

I don't know if the question trivial or not (if so I will delete it), but here is what I have: I know that x x (* x^2 *) Looking at the full form gives ...
13
votes
2answers
265 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 ...
0
votes
1answer
105 views

Need help in understanding code [closed]

I am just beginning with Mathematica. I have received this code to study. I am not able to follow this particular section. I have tried looking it up on many forums, with no answer. Can you help? ...
3
votes
0answers
268 views

Is Wolfram Language suitable for building web applications? [closed]

My goal is to find a technology which will afford me to build web applications (e.g. simple social networking site) as quickly as possible (with as little code as possible). I was impressed by Stephen ...
15
votes
1answer
313 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 ...
4
votes
1answer
122 views

Multiple down-values with exactly the same lefthand side

I was working on an answer to this question, when I was sidetracked by what I bring up here. I wanted a function, which when given a string representing a binary number, would convert the string to a ...
2
votes
1answer
45 views

Is the use of Block to temporarily override definitions inherently unsafe? [duplicate]

This may have been discussed before, if so, please let me know. Consider the following example: x = 5 Dynamic[{Clock[], x}] This will always display the ...
1
vote
1answer
72 views

Why is Return not forcing an exit from my function? [duplicate]

Here is simplified version of my code that exhibits the behavior troubling me: ...
8
votes
3answers
643 views

Why are functions called first-class objects in Mathematica?

I've heard lots of people say a function is a first-class object in Mathematica. "Everything is an expression, including function." "There is no distinction between functions and data." Having read ...
7
votes
3answers
239 views

Implementing key-value associations in Mathematica 9 with inexact numbers for keys

I'm not sure of what type of problem my issue falls into, so I haven't been able to search forums with any success. If this has already been solved then my apologies! Essentially I'm trying to set a ...
1
vote
2answers
130 views

Unexpected Plot3D behaviour

The following illustrates what appears to be an incorrect Plot3D for this polynomial. I have forced the function to complex argument, changed ranges. In contrast, ...