In many MATLAB plotting functions, you can specify the color as either a string or as a 3 element vector that directly lists the red, green, and blue values.
For ins
I don't think there is a function for this in matlab. I suggest you use Marcs function, or this one-liner.
C = rem(floor((strfind('kbgcrmyw', C) - 1) * [0.25 0.5 1]), 2);