I already know uint8 contains intensity values between 0 and 255 (28-1) and single contains values between 0 and 1, it is used to hold larger values without upsetting the range error. But, apart from that, are there any other differences?
What is the difference between imagesc((I/64)*64) and imagesc((Is/64)*64), where I is uint8 and Is is single?
Dividing an integer basically means binning of values, and then it stretches the data back to the original extend for plotting. In this case, you get
256/64 = 4bins, with 0 as well, thus 5 possible values for youruint8image. However, usingsingleyou retain all unique numbers, since the precision is a lot higher.If you'd do the same test with a lot (order 2^52) elements in the
randand usedoubleyou'd see that that again has 2^32 times the number of unique elements ofsingle, just asuint16will have 2^8 the number of unique elements ofuint8.