Message Boards Message Boards

0
|
2976 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How to do an indexed replace?

Hello!

Is it possible to do repeated replace for "k" according to its position in a list like this?

list = {Subscript[a, k], Subscript[a, k] + Subscript[b, k], Subscript[
  c, k], Subscript[d, k] + k}

Jesus

I have found this in the documentation.

n = 1; {x, x, a, b, x, x, c, d} /. x :> n++

Just what I need!

Thanks

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract