I have two [24 x 3] matrices, one for fractionnal [0 to 1.0) RGB numbers and one for fractional (0 to 1.0) XYZ numbers.
I'd like to use Matlab to compute the Least Squares polynomial regression to relate these two sets of numbers.
My XYZ matrix looks like this :
XYZ_X XYZ_Y XYZ_Z
0.1167 0.1006 0.0499
0.3916 0.3048 0.0457
0.0687 0.0552 0.2 ...
My RGB matrix looks like this :
Ravg Gavg Bavg
0.0378033 0.047519 0.027234
0.1264551 0.107156 0.032512
0.0168213 0.0471 0.074999 ....
Most examples I find relate only two 1D sets of numbers like this :
x = [1 2 3 4 5.5 7 10]
y = [3 7 9 15 22 21 21]
And do a least squares fit this way :
p2 = polyfit(x, y, 2)
But I have 2 sets of 3D numbers?
I'm going in cirle because I can't figure how to pose the problem.
Any help is appreciated.