Hello Leonardo,
If all variables are of int32 datatype, then they can only contain integer values. Thus, dt would contain 0, rather than 0.02, because when a floating point number is cast to an integer datatype, the non-integer part is dropped.
Even if dt is actually a floating point datatype, if you do a double*integer, MATLAB will make the result an integer datatype:
0.02*int32(-6)
ans =
int32
0
Sounds like you might want to cast everything to double before doing your computation. -Cam