Linked Questions

3 votes
1 answer

What is the meaning of two square brackets in function definition? [duplicate]

I came along the following function definition f[a_, b_, c_][r_] = ... with some function on the right hand side. Is this equivalent to ...
wondering's user avatar
  • 595
1 vote
0 answers

what is the difference between these definitions? [duplicate]

I define 2 functions: g[s_][x_,y_] := the gaussian (1) g1[s_,x_,y_] := the gaussian (2) I get the same answer using ...
Sid's user avatar
  • 121
2 votes
0 answers

Confusing alternative definition of a function [duplicate]

I saw a function defined something like the following: f[n_Integer][r, θ] = Sin[n r π/L] Cos[n r L π θ/4] My question is, why did my professor define the ...
Shinaolord's user avatar
67 votes
6 answers

V10's Operator Forms - what are they good for?

V10 introduces an operator form for several functions perhaps primarily due to their role in queries as part of introducing data science functionality. At first pass it seems a lot of effort to add ...
Ronald Monson's user avatar
56 votes
2 answers

How do you set attributes on SubValues?

SubValues, as discussed in a previous question, are declared as follows ...
rcollyer's user avatar
  • 34k
23 votes
4 answers

How do I use Map for a function with two arguments?

I'm a newbie who tries to be a good boy, and use Map instead of writing out a list of functions. I have a table I want to Map ...
stevenvh's user avatar
  • 6,958
22 votes
2 answers

How can one define a custom data object?

In Mathematica there are different objects like InterpolatingFunction or SparseArray? How can I define a custom data object with ...
PlatoManiac's user avatar
  • 14.8k
15 votes
2 answers

Need help coding/creating a recursive list

I have two lists A and B, each with 99 real numbers. I want to form a list, C, whose ...
Garcia's user avatar
  • 153
9 votes
3 answers

Postfix with two arguments

This must be a duplicate but I can't find any related post. I want to pass two arguments to a function using postfix syntax like f[a_,b_]:=a+b; 1,2//f More ...
Kafkarudo's user avatar
  • 619
12 votes
3 answers

Proper way to handle free variables in manipulate/plot?

It took me a while today to figure out that Manipulate (used with Plot) requires that the variable I'm manipulating be an actual ...
Noon Silk's user avatar
  • 523
11 votes
2 answers

Built-in symbols that support operator form [duplicate]

In version 10 some built-in symbols are updated to support operator form like the Derivative. For example, Select, ...
saturasl's user avatar
  • 1,429
5 votes
3 answers

What is the right way to write a function that includes other functions?

I want to include multiple sub functions: $b(x) = 10x$ $w(x) = s + b(x)$ $c(x) = x^2$ into two main functions: $ua(x) = w(x)-c(x)$ $ub(x) = w(x)-c(x)^2$ As a reaction to this answer, I wrote ...
Jan's user avatar
  • 161
4 votes
4 answers

Pure function, one slot refers to List-position

I used all my google-fu trying to find how to make this work; read the docs as well. What have I missed? I feel sure this can't be a new question, but I can't find anything Here is is: ...
Paul_A's user avatar
  • 487
2 votes
3 answers

How to combine multiple functions into a single function, indexed bya new argument

I have a system of expressions (matrices) which correspond to increasing orders of precision in a theory. These expressions are quite complex (require about 40+ lines of code to produce) and are not ...
Steve's user avatar
  • 1,153
3 votes
2 answers

How to define multiple functions using a for command

Let's say I want to plot 10 graphs of those following functions. Since they are recursive functions, I cant make a table with 10 different initial conditions because Mathematica stores each value ...
Geo's user avatar
  • 461

15 30 50 per page