I have a 2D matrix which has the size 65536 × 1
, if I want to convert it to a 3D in MATLAB, first I should convert it to a 256 × 256
, and then that 256 × 256
into an 3D.
Can anyone help me with that?
I have a 2D matrix which has the size 65536 × 1
, if I want to convert it to a 3D in MATLAB, first I should convert it to a 256 × 256
, and then that 256 × 256
into an 3D.
Can anyone help me with that?
To convert your greyscale image (that somehow has been vectorized) into an RGB image, just copy the greyscale intensities into the RGB layers:
%// first, reshape
img = reshape(img, 256, 256);
%// then, copy
img = repmat(img, [1 1 3]);