Linked Questions

6 votes
4 answers

Defining a function with parameters as variables [duplicate]

I have an expression V = (a[1] + a[2])b[1]. How would I define a function of a[1], a[2] and <...
user avatar
0 votes
2 answers

How to correctly specify variables in a function? [duplicate]

There is an expression ...
Mam Mam's user avatar
  • 1,863
0 votes
1 answer

Is it possible to define a function like this f[K[1]_,K[2]_,K[3]_] [duplicate]

f[K[1] _, K[2] _, K[3] _] := 32 b^9 + 4 b^3 Cosh[b/2] K[1] K[2] - 4 b^3 Cosh[b/2] K[1] K[3] f[10,10,10] I have an equation which is a function of K[1], K[2] and ...
acoustics's user avatar
  • 1,709
0 votes
1 answer

Part of array as a blank variable [duplicate]

I have a little question. Let me define the function: f[k_]:=k So 'k' in the argument of 'f' is a blank variable. Is there a way to define a part of array as a ...
Lorenzo Bagnasacco's user avatar
213 votes
26 answers

What are some useful, undocumented Mathematica functions?

There have already been some questions about some undocumented functionality in Mathematica. Such as (please add to these lists!) How can one find undocumented options or option values in Mathematica?...
44 votes
4 answers

Is there a convenient way to copy/paste text-interspersed SE code snippets into Mathematica?

Is there a way to copy and paste code snippets from SE to Mathematica if these snippets are interspersed with text? Like e.g. in Morphing Graphics, color and location in both the question and answer, ...
Yves Klett's user avatar
  • 15.4k
47 votes
2 answers

How to work with Experimental`NumericalFunction?

This question is intimately connected with previous one: "How to create internally optimized expression for computing with high WorkingPrecision?" Oleksandr R. correctly states in the comment: A ...
Alexey Popkov's user avatar
22 votes
3 answers

How to use subscript in pattern names?

For example I want to define a function with parameters σx and σy, that is, the function will be declared as: f[σx_,σy_] := . . ....
Ziyuan's user avatar
  • 1,075
4 votes
2 answers

Applying rules with functions to expressions with derivatives

I have a function that I want to see applied, potentially within a derivative. The use of delayed vs. non-delayed rules seems irrelevant. See the following: ...
jlperla's user avatar
  • 977
1 vote
1 answer

Function definition with sub (super) cripted variables [duplicate]

I like using subscripts a lot. However, it is regrettably not possible to do, for example: myfunction[Subscript[x,1]_] := Subscript[x,1] +1 where instead of the ...
Patrick.B's user avatar
  • 1,511
1 vote
3 answers

Functions with a greek, subscripted argument [duplicate]

I am working on a problem with a lot of (greek) variables and it makes sense to sub-script them. Some of them must appear in functions and I am having trouble using greek, subscripted variables ...
villaa's user avatar
  • 187