User`s guide

R2014a
3-16
Compatibility Considerations
In previous releases, the output class of these functions was dependent on the input
class. To obtain nondouble output, cast the output into the required class, such as
int8(sub2ind(size,i,j)).