I just came across something concerning data types which I find astonishing.
i1 = int8( 10 ); class( i1 )i1 = 10.1; class( i1 )
i1 is int8 after the first line, but changes to double in the 2nd line
im1 = int8( [1 2 3]); class(im1)im1(1) = 1.1; class(im1)
im1 is int8 after 1st line and remains int8 in the 2nd line, i.e. the floating point value is casted to int8
Why is the behaviour different depending on the matrix size? Is this explained somewhere in the documentation?
I use R2015b.
Best Answer