tgt
- 519
- 2
What does f[a] mean in mathematica?
What does f[a] mean in mathematica?
What does f[a] mean in mathematica?
CompuChip said:How do you mean "indexed" by i = 1, 2, 3? You would like three functions F[x], G[x], H[x] but call them Fi[x] (i = 1, 2, 3) instead?
Subscript[g, 1][x_] := x
Subscript[g, 2][x_] := x^2
Subscript[g, 3][x_] := Sin[x]
Plot[{Subscript[g, 1][x], Subscript[g, 2][x],
Subscript[g, 3][x]}, {x, -1, 1}]
Subscript[f, i_?(Function[IntegerQ[#] && 1 <= # <= 3])][x_] :=
Which[i == 1, F[x], i == 2, G[x], i == 3, H[x], True, "This should not occur!"]
CompuChip said:So the simplest form is
Code:Subscript[g, 1][x_] := x Subscript[g, 2][x_] := x^2 Subscript[g, 3][x_] := Sin[x] [/QUOTE] why g?