Grayscale images only have one channel while RGB has three channels for each of the R(ed), G(reen), and B(lue) when the values of each channel is equal, you get different shades of grey (no pun intended). So all you need is to copy your one channel into two others and concatenate all of them in the depth dimension.
MATLAB do not have a gray to RGB function because theoretically we can not convert a grayscale image to RGB (we do not have color information). we can do some tricks like repeating the gray values for all channels, as mohamed has mentioned. Depending upon why you are trying to convert to RGB, it may or may not have a benefit.