Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Changing Rules?' topicStudent Support Forum > General > "Changing Rules?"

Next Comment >Help | Reply To Topic
Author Comment/Response
Martin
03/26/10 05:01am

I have a list of rules (input data) that looks something like this:

data = {
X[a]->1,
X[b]->2,
X[c]->3,
Y[d,e]->4,
Y[f,g]->5,
...
}
X and Y are not defined anywhere else (as functions).

now i want to automatically change these rules to this:
data = {
X[a]->P[1,m],
X[b]->P[2,m],
X[c]->P[3,m],
Y[d,e]->P[4,n],
Y[f,g]->P[5,n],
...
}

is that possible?

my biggest problem is, that i didn't find any possibily to "extract" the left- and right hand side of a rule?

URL: ,

Subject (listing for 'Changing Rules?')
Author Date Posted
Changing Rules? Martin 03/26/10 05:01am
Re: Changing Rules? Nasser M. Ab... 03/26/10 5:02pm
Re: Changing Rules? Tom 03/27/10 9:48pm
Next Comment >Help | Reply To Topic