[rgb,M] = XYZToSRGBPrimary(XYZ)

Convert between CIE XYZ to sRGB primary
coordinates. These are linear device
coordinates for the primaries of the sRGB
standard. If your input is scaled in the
gamut of the monitor, the numbers will come
out in the range 0-1. You may want to scale
the result into the range 0-1 before applying
sRGB gamma correction.

Originally implemented from conversion matrix as specified at:
It turns out this was the draft standard. The site above is gone
You can still find the draft standard at:

I can’t find the official technical standard on the web, but
there is pretty good agreement across web sources. Wikipedia
seems fine, as does.

5/1/04 dhb Wrote it.
7/8/10 dhb Updated to match standard I can now find on the web.

Path   Retrieve current version from GitHub | View changelog