## Why is the result calculated in MATLAB different to the result using a simple calculator?

### Manuel Zahn (view profile)

on 30 Nov 2012

% Calculation of the chemical degradation rate k of a substance based on slope and intercept of the Arrhenius Plot ln k = slope * (1/T) + intercept

```clear, clc
close all
% 1/T [°K] at 5°C
kelv=273.16;
temp5=5+kelv;
x1=1/temp5;
% slope of Arrhenius Plot
slopeA=-8729.3;
% intercept of Arrhenius Plot
interc=29.928;
% Degradation rate k at temperature T
lnk5=(slopeA*x1)+interc
k5=exp(lnk5)
```

The result is k=0.2336 [per month] calculated using MATLAB but 0.2237 if calculated using a simple calculator! I am lost ...

## Products

No products are associated with this question.

### Image Analyst (view profile)

on 30 Nov 2012

I get this:

```lnk5 =
-1.45429795800977
k5 =
0.233564278287803
```

Seems to be different than what you got. But I had:

```format longg;
format compact;
```

in the script before your code. Have you seen the FAQ: http://matlab.wikia.com/wiki/FAQ#Why_does_MATLAB_only_calculate_to_4_significant_digits.3F

#### Join the 15-year community celebration.

Play games and win prizes!

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