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

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

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

Asked by Manuel Zahn 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 ...

0 Comments

Manuel Zahn

Products

No products are associated with this question.

1 Answer

Answer by Image Analyst 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

0 Comments

Image Analyst

Contact us