If you haven't played with matlab before there is a great wiki entry on it.
I've found one of the whitepapers, I'll host it for a while here:
colourmatching
If you read the whitepaper then follow the sample code it should become clear what the code is doing, and then you could incorporate it into your own programs.