Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: extract from Reduce
Replies: 3   Last Post: Apr 6, 2013 5:10 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jakub Serych

Posts: 51
Registered: 1/27/08
Re: extract from Reduce
Posted: Apr 4, 2013 10:30 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Try ToRules[] and than /. and you have pure list of results. For example:

x /. {ToRules[Reduce [x^8 == 1]]}

Jakub

> -----Original Message-----
> From: hamiltoncycle@gmail.com [mailto:hamiltoncycle@gmail.com]
> Sent: Thursday, April 04, 2013 4:51 AM
> To: mathgroup@smc.vnet.net
> Subject: extract from Reduce
>
> I have a result from the command Reduce that looks like this (as an
> example):
>
> a:= x==3||x==4||x==7
>
> I need to extract the numbers but I can't find a nice way to handle the case
> when there is only one equation, for instance:
>
> a:= x==6
>
> currently I check what the head of the expression is (Head[a]) and handle
> the case Head[a]=Or with a Map[] and the case Head[a]="Equal" with a[[2]].
> Not very nice, but I guess that there is a neat way to do it.
>
> cheers, Robert






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.