represent vector as a color
Show older comments
This isn't specifically a MATLAB question, although a solution in MATLAB would be nice (if there is a solution).
Lets say I have some vectors, say '<1,2,7,6,10> and '<3,4,6,1,4>.
Is there any way to represent each of these vectors as a single color? I am looking for a way to "color" n-dimensional vectors with a single color - I'm not sure that it's possible.
3 Comments
Fangjun Jiang
on 31 Aug 2011
What do you mean single color? If there is only one color, how do you tell the difference?
Craig
on 1 Sep 2011
Fangjun Jiang
on 1 Sep 2011
pcolor() will show that vector [1,2,7,6,10] and [1.1, 1.9, 7, 6.1, 9.9] are similar but of course they contain multiple color grids.
Accepted Answer
More Answers (1)
Daniel Shub
on 2 Sep 2011
0 votes
As Walter said, color is a three dimensional precept. Printers use CMYK to generate there colors, but all this means is that there are multiple was of combining inks to produce the same color. Monitors work with RGB. There are a number of ways of reducing the dimensionality of your data set (clustering is one and principal component analysis is another). It seems like you have a grasp on this.
Basically you need to map from a N-D space to a 3-D space. You then want to map from the 3-D space to a color space. A trivial mapping would be to use the magnitude of each of the 3 dimensions to drive the R/G/B of your monitor. Unfortunately, this will result in a warped color space: some points which are close in your 3D space will be perceptually very different and some points which are far apart in you 3D space will be perceptually similar. A better mapping would be to use an LMS color space. Ideally, this would be done with a calibrated monitor, but that is probably overkill.
It looks like: href=""<http://www.mathworks.com/matlabcentral/fileexchange/28790-colorspace-transformations</a>>
can convert RGB to LMS.
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!