Skip to main content

changing a symbol into a function variable

Struggled for a while on this problem and hopefully you can help... I have a mathematical expression that currently has a symbol where I used to have a function variable. How do I make the symbol back into a variable, so that my expression becomes a function again? My function became an expression when I saved it in a matrix, and so now I'm trying to make the different matrix elements back into functions after having constructed the matrix. Thanks in advance.

INCLUDING SOME CODE (my first time contributing on this website...)

Imagine a For loop sum (I've removed a substantial amount of code that's irrelevant for now)

Pstatesalpha[λ_]={};
For[jsum = 1, jsum <= 3, jsum++,(
Pstatesalpha[λ_] = (delem*a0)^2*SumPstatesalpha[λ] + Pstatesalpha[λ];
AppendTo[RankMatrix, {Alpharank,Pstatesalpha[λ]}])

Note that I've saved Pstatesalpha[λ] as a function into RankMatrix. When I want to access (for instance)

RankMatrix[[1,2]]

Mathematica returns an expression that includes $\lambda$, but I can't use it as a function anymore.

Verde
  • 85
  • 5