In MATLAB itself, the way to do it would be
cat(3, GrayScaleImage, GrayScaleImage, GrayScaleImage)
or (more obscurely but correct and efficient)
GrayScaleImage(:,:,[1 1 1])
That is, take three copies of the grayscale image and put them together along the Z axis.
I do not know the Simulink methods to achieve the same thing.
You need to consider, though, whether what you want is the grayscale image in the form of an RGB image, which would give you an RGB image that consisted entirely of grays. Or do you instead need to use the results of processing the grayscale image to select or modify portions of the original RGB image, producing a full-color RGB output? Such as, for example, the RGB image with edges "drawn" on it.
Best Answer