Questions on correct (or improved) formulation of Mathematica code to achieve particular results. Use this tag (not "symbol") for questions about all those odd @@ /@ # & and ~ characters.

learn more… | top users | synonyms

-4
votes
0answers
31 views

Extracting arguments from output [on hold]

Running this : Table[Expand[(1 + x)^n], {n, 0, 2}] I get the following output : (1,1+x^2+2x)) How can I extract the second ...
1
vote
0answers
23 views

Matching Root[…] objects with patterns, unexpected hidden argument

I needed to write patterns that could distinguish between arbitrary-function and polynomial forms of Root objects, for example, ...
1
vote
0answers
61 views

Defining an operator

Let s be a positive integer and let DifferenceDelta be this function with step = 1. Define ...
0
votes
1answer
62 views

Plot producing many error messages when given complicated function

I'm new to Mathematica and am running in to all sorts of silly difficulties with coding in it. I'm trying to calculate a function f[x, k], normalise it with another ...
2
votes
4answers
126 views

Where did I go wrong with my implementation of finding a plane tangent to a surface?

I am working on finding the plane tangent to a paraboloid at a given point. My code: ...
3
votes
1answer
48 views

Why only up to two \[Prime] superscripts are interpreted as derivatives?

I noticed that only up to two \[Prime] superscripts are interpreted as derivatives. Is there a reason for this restriction? Is it documented? ...
6
votes
3answers
183 views

Where did I go wrong with my implementation of the trapezoidal rule?

One method for doing quadrature, called the trapezoidal rule, improves accuracy by connecting the points on the curve corresponding to the points of subdivision with line segments, forming trapezoidal ...
-7
votes
0answers
85 views

How to calculate this sum in Mathematica [closed]

$$x_1=1,x_2=2,x_3=3$$ and I want to calculate: $$\sum _{i=1}^3 x_i$$ How can I calculate with Mathematica using the form Sum[...] Thanks
1
vote
2answers
93 views

Shortcut for Range[]?

I use Range a lot. Is there any syntactic shortcut for it, or do you always have to spell it out?
1
vote
1answer
66 views

Passing f[x][[1]] to FindRoot [duplicate]

FindRoot seems to fail for most examples of the form f[x_?NumericQ] := {x - 3 , x^3}; FindRoot[f[x][[1]], {x, 3}] ...
2
votes
0answers
32 views

Syntax for FrontEnd`SelectionSetStyle

I know FrontEnd`SelectionSetStyle is undocumented, but its name suggests it does what I need. What is its syntax? I have already tried several variations of the ...
2
votes
1answer
63 views

Is it possible to use a mathematical expression as function name?

This might seem as a silly question, but is it feasible to use a mathematical expression as the name of a function? For example, I'm studying the cross section of Compton scattering and there is a ...
1
vote
4answers
87 views

Help with writing a polynomial series [duplicate]

I want to write and evaluate an expression something like Sum[x[i] Product[y[j], {j(!=i), 1, n}], {i, 1, n}] but with correct syntax, where n is a any number ...
6
votes
1answer
82 views

Where does Documentation Center introduce the basics?

While helping a user who mistakenly thought that log rather than Log was the correct built-in function name, I included a ...
3
votes
1answer
123 views

Levels and slots

I am struggling with levels and #, if I understand this I think I will be able to grasp the entire concept. ...
2
votes
1answer
73 views

Manipulate, Import external table, save as CDF, mail presentation

For my work I do data analysis. Most of these analysis are done on big databases with milions of records. I would like to make a manipulate (or animate) using a external dataset and create a CDF ...
2
votes
2answers
106 views

HoldForm[Operator ##] on some list

Recently in response to this question Mr.Wizard suggested an unusual way to summing numbers. This doesn't seem to be documented. ...
6
votes
3answers
194 views

Guidelines on giving readable names to variables [closed]

I know that one cannot use underscore to a variable name, like degree_of_The_First_Polynomial. But for a long variable name, it ...
0
votes
0answers
88 views

The /. syntax in numerical methods [duplicate]

I have an analytical approximation method for solving an ODE and want to compare this to an NDSolve solution, but the syntax is confusing me. To get the solution from NDSolve, I define the ODE as eqn ...
11
votes
3answers
299 views

How is + as an infix operator associated with Plus?

How is + associated with Plus? Suppose I want to define a head FooBar and have it ...
4
votes
2answers
110 views

Can someone explain this code for joining two lists by the first element of each sublist?

Background (which may be skipped, unless context is needed) I've recently begun learning Mathematica (and only up to chapter 3 of Wellin), but wanted to write some code to get a better feel for ...
11
votes
4answers
174 views

Constraint syntax compaction

Is there a more compact way to represent these constraints: NMaximize[{a+b+c,...
10
votes
1answer
133 views

Infix form of PutAppend ( >>> ) does not work with variable

I'm new to Mathematica, so I suspect this question involves either a misunderstanding involving variables or the usage of >>>. On a webMathematica page ...
2
votes
2answers
145 views

Writing a function that returns a (usable) function

I am trying to create a function that returns Arnold's Cat Map of size n iterated k times. I can get something out of the Function command, but I can't figure out ...
4
votes
3answers
199 views

What is the right way to construct DynamicModule

When I'm creating DynamicModules for CDF purposes I'm usualy basing on my experience with that, particular goal and content rather than on deep insight. I want to ...
1
vote
1answer
68 views

Why do two codes give different output?

I have tried the following to get the eigenvalues of several matrices of the type: ...
4
votes
1answer
62 views

Constructing an Array from typed expression

I want to produce an array from expressions given by test[one][1] = 3; . . test[one][5] = 7; etc. Normally would use ...
3
votes
1answer
87 views

How to make InverseFunction work on function defined with restriction on arguments

This example works to define InverseFunction on the first argument of a function ...
4
votes
2answers
191 views

Overlapping pure functions

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

Split dataset based on the first column [duplicate]

I have a dataset which I want to split based on the first column. The data looks like this ...

15 30 50 per page