MATLAB: Why matlab2018a gives “vpa(int( exp((t-360​).*[0,1e-1​6,1e-15,1e​-14,1e-13,​1e-12,1e-1​1]) , t, 0,360 ))=[ 360.0, 0, 0, 0, 256.0, 368.0, 360.0]”?

MATLABvpa int near zero number included

Hi all,
Weird the matlab 2018a calculate the below code–
syms t;
vpa(int( exp((t-360).*[0,1e-16,1e-15,1e-14,1e-13,1e-12,1e-11]) , t, 0,360 ))
resulting in
[ 360.0, 0, 0, 0, 256.0, 368.0, 360.0]
Do you guys have expertise helping avoid this happening?
thanks a lot
J

Best Answer

Hello Jiyuan,
I couldn’t reproduce your result in both R2018a and R2015a. Here is what I got: [ 360.0, 359.99999999999352000000000231367, 359.99999999993520000000000783383, 359.99999999935200000000077761612, 359.99999999352000000007775999991, 359.99999993520000000777599999918, 359.99999935200000077759999930015]
Please try changing different data type and see if you still have the issue.
Thanks,
Siwan