Message Boards Message Boards

0
|
1531 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to separate, in a list, symbols and numbers?

Posted 1 year ago

Hello

ex= 2.5 x/(y*z)

How to proceed to separate the symbol and the number of the expression above in a list of the type:

{2.5,x(y/z)}

Sincerely,

Sinval

POSTED BY: Sinval Santos
2 Replies
Posted 1 year ago

The second option was better for my purpose. Thanks for the tip Hans.

POSTED BY: Sinval Santos
Posted 1 year ago

Maybe:

ex = 2.5 x/(y*z);

GatherBy[List @@ ex, NumericQ]

Another one:

{First@ex, Rest@ex}
POSTED BY: Hans Milton
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