When a number is read as an integer using the format "%d" from a file using TEXTSCAN, MATLAB saves the number as int32.
Any arithmetic operation performed on this integer will therefore result in an integer instead of a float. This is documented in the link below:
<http://www.mathworks.com/access/helpdesk/help/techdoc/ref/int64.html>
The above help documentation can also by accessed by typing the following at the MATLAB command prompt:
web([docroot,'/techdoc/ref/int64.html'])
Note that under the "Remarks" section, it reads,
"Integer arrays may also interact with scalar double variables, including constants, and the result of the operation is an integer array of the same class."
If you wish to get a floating point number as the output of arithmetic operation, use the format "%f" while reading the number from the file using TEXTSCAN.
Best Answer