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 calculation accuracy

Subject: Matlab calculation accuracy

From: Xiaoxia Wang

Date: 24 Oct, 2000 21:52:48

Message: 1 of 2

I use Matlab to do reliability calculation. As we know,
the value for parameter coverage is sth like 0.9, 0.99,
0.999, 0.9999...While multiple by failure rate, which is
usually less than 0.0001, the result is less than 0.0001.
But Matlab only display 4 bits, then the result of 0.99999
and 0.9 will be the same. Anyone has any good suggestion
to solve it? Thanx a lot!

Subject: Matlab calculation accuracy

From: Nabeel

Date: 24 Oct, 2000 22:25:14

Message: 2 of 2

Hi,

MATLAB does arithmetic in double precision, giving you about 16
significant digits. The command window only shows the first few. The
FORMAT command (type 'help format') will let you change this.

For example:

>> pi
ans =
    3.1416
>> format long
>> pi
ans =
   3.14159265358979

>> format long e
>> pi
ans =
    3.141592653589793e+000

>> format bank
>> pi
ans =
          3.14


hth,

Nabeel

Tags for this Thread

No tags are associated with 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