% function[colorTrans]=Model2(rgb,xyz);
% Uses [R G B RG GB BR] model to fit data.
% Input: rgb, 6xN matrix of checker R G B RG GB BR values
%        xyz, 3xN matrix of checker XYZ values
% Ouput: colorTrans, 9x3 matrix of coefficients with best
% estimate of xyz=colorTrans*(r;g;b;rg;gb;br;rr;gg;bb)
%

function[colorTrans]=Model2(rgb,xyz);
rgb2 = Model2Rgb(rgb);
colorTrans = rgb2'\xyz';
colorTrans=colorTrans';

