Group Abstract Group Abstract

Message Boards Message Boards

0
|
3K Views
|
4 Replies
|
1 Total Like
View groups...
Share
Share this post:
GROUPS:

Turn a product of elements into a list

Posted 11 years ago
4 Replies

This may work:

Cases[x[i][t]^3*y[k][t2], a_[i_][t_]^n_. :> Table[a[i][t], {n}], 
  1] // Flatten
POSTED BY: Gianluca Gorni

This works, thank you very much!

This almost does the job, but I would need terms like (x[i][t])^3 to be recognized as three different x[i][t] items in the output list!

Perhaps you can do it with Cases and a pattern:

Cases[x[i][t]*y[k][t2], (x | y)[i_][t_], All]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard