Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
matlab output format problem

Subject: matlab output format problem

From: krymly

Date: 11 Apr, 2010 22:41:41

Message: 1 of 3

well basicly I wrote a little program. It should display a 1xSomething matrix with numbers, the thing is I want all the numbers to be displayed in a "normal" format, so not scientific, fractioned or anything. but this is what I get:
 7250531517275832*2^(-39)
                      744
                      744
                 32953/25

Now am I doing anything wrong? if not then whats the problem?

Subject: matlab output format problem

From: Walter Roberson

Date: 12 Apr, 2010 05:37:33

Message: 2 of 3

krymly wrote:
> well basicly I wrote a little program. It should display a 1xSomething matrix with numbers, the thing is I want all the numbers to be displayed in a "normal" format, so not scientific, fractioned or anything. but this is what I get:
> 7250531517275832*2^(-39)
> 744
> 744
> 32953/25
>
> Now am I doing anything wrong? if not then whats the problem?

Your problem is that you haven't defined what you mean by "normal"
format, aside from defining that it is _not_ scientific, _not_
fractioned, and _not_ anything else either.

Make sure you have not set 'format rational'. If the fractions were
generated out of a symbolic process, then you may wish to use double()
or vpa() on the numbers.

Subject: matlab output format problem

From: ben payne

Date: 18 Apr, 2010 16:16:04

Message: 3 of 3

krymly <hidde_norder@msn.com> wrote in message <780961510.547480.1271025731052.JavaMail.root@gallium.mathforum.org>...
> well basicly I wrote a little program. It should display a 1xSomething matrix with numbers, the thing is I want all the numbers to be displayed in a "normal" format, so not scientific, fractioned or anything. but this is what I get:
> 7250531517275832*2^(-39)
> 744
> 744
> 32953/25
>
> Now am I doing anything wrong? if not then whats the problem?

On method would be to display the array result one element at a time.

Alternatively, if the array is called "fish", then set the number of digits to be as large as the smallest value needs:
vpa(fish,50)

Tags for this Thread

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.

Contact us