Group Abstract Group Abstract

Message Boards Message Boards

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

Collect[ ] function for vectors {a x, c x} --> x {a, c} ?

Posted 10 years ago

Hi,

I want to rearrange a term so that I can bring out a symbol (that exists in each component of the vector) out of a vector.

In a scalar term (tensor order #0), I get it successfully by the "Collect" function:

input: Collect[a x + c x, x]
output: (a + c) x

so, I am happy with this.

But when I tried this function at a vector (tensor order #1), it does not work the way I want:

input: Collect[{a x, c x}, x]
output: {a x, c x}

But the output, I want to have, shoud be: x {a, c}

Please can you help me? Maybe I forgot some parameters in the "Collect" function or I need a completely different function for my problem. I do not know.

Thanks. Matthias

Wolfram Mathematica Student Edition Version 9.0.1.0 Windows 8.1, 64 bit

POSTED BY: Matt Po
4 Replies
Posted 10 years ago
POSTED BY: Matt Po
Posted 10 years ago
POSTED BY: Matt Po
POSTED BY: Sander Huisman
POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard