MATLAB: How to get RGB values from x,y coordinates

rgb color space

I have the x,y coordinates of different colors (they are not coordinates of an image, just the hue coordinates) in CIE color space and I want to convert them into RGB values. i have for example x= 0.5732 and y= 0.2463. How can I convert these coordinates to RGB?

Best Answer

https://www.mathworks.com/help/images/ref/xyz2rgb.html (z is just to complete the triplet, in general z=1-x-y)
Note: Make sure that you pick the correct whitepoint. Generally there will not be much difference between D65, A and an ideal 6500K black body radiator, but sometimes it matters for your result.