convert matrix of uint8 to double in matlab

To convert a matrix of uint8 data type to double data type in MATLAB, use the double() function.

Here's an example:

main.m
% create a matrix of uint8 data type
A = uint8([1, 2; 3, 4]);

% convert to matrix of double data type
B = double(A);
118 chars
6 lines

In this example, matrix A is created with uint8 data type. double(A) performs the conversion to matrix B of double data type.

Note that the result will be a matrix of doubles with values ranging from 0 to 255.

gistlibby LogSnag