Thread Subject: Numerical representation

Subject: Numerical representation

From: Py

Date: 25 Sep, 2007 21:49:50

Message: 1 of 4

Hi,

Is there any command that let me change numerical number into a more readable form?

For example, instead of displaying

a =

0.833 -0.833

I want


a =

1/12 -1/12


I have seem Matlab sometimes return answer in like sin(2*pi), and sometimes like 23423423/42304923423. The latter is obviously a less desirable.

Any suggestion will be appreciated.

Subject: Numerical representation

From: Laszlo

Date: 25 Sep, 2007 22:33:55

Message: 2 of 4

py <pyjunk@shaw.ca> wrote in message
<29080650.1190757020349.JavaMail.jakarta@nitrogen.mathforum.org>...
> Hi,
>
> Is there any command that let me change numerical number
into a more readable form?
>
> For example, instead of displaying
>
> a =
>
> 0.833 -0.833
>
> I want
>
>
> a =
>
> 1/12 -1/12
>
>
> I have seem Matlab sometimes return answer in like
sin(2*pi), and sometimes like 23423423/42304923423. The
latter is obviously a less desirable.
>
> Any suggestion will be appreciated.

Symbolic toolbox can do it. But in that case values will be
sym objects rather than double matrices. Try:
sym(1/12)
double(23423423/42304923423)

Subject: Numerical representation

From: Py

Date: 25 Sep, 2007 23:52:12

Message: 3 of 4

thanks!

Subject: Numerical representation

From: Doug Schwarz

Date: 26 Sep, 2007 01:21:06

Message: 4 of 4

In article
<29080650.1190757020349.JavaMail.jakarta@nitrogen.mathforum.org>,
 py <pyjunk@shaw.ca> wrote:

> Hi,
>
> Is there any command that let me change numerical number into a more readable
> form?
>
> For example, instead of displaying
>
> a =
>
> 0.833 -0.833
>
> I want
>
>
> a =
>
> 1/12 -1/12
>
>
> I have seem Matlab sometimes return answer in like sin(2*pi), and sometimes
> like 23423423/42304923423. The latter is obviously a less desirable.
>
> Any suggestion will be appreciated.

format rat

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
symbolic Laszlo 25 Sep, 2007 18:35:05
rssFeed for this Thread

Contact us at files@mathworks.com