2. If the color matching matrix for primaries Palt is called Malt, then that the equivalent spectrum to any 'light' for Palt would be

  Palt*Malt*light
  
This result is another (31-element) sampled spectrum, just like 'light' was.

Since 'M' is the color matching matrix for the original primaries, and M times this alternative light made out of the Palt primaries will be the same as M*light was, because they will both look the same and also be constructed as a linear combination of the same (original) primaries.

Thus for any test light at all

M*Palt*Malt*light = M*light

Since you know what 'M' and 'Palt' are, and since 'light' can be factored out of the equation, you should be able to solve this equation for the alternative color matching matrix 'Malt', using 'inv()'.

4. After you compute the SVD of M2, look at the "singular values" (on the diagonal of the 'S' matrix in [U,S,V] = SVD(X)). These tell you something about the degree of influence of the dimensions in the new coordinate system that the SVD has produced. You could compare the singular values in the SVD of M2 with the singular values in the SVD of M. A significant difference should be apparent. Try to figure out what it means, and why.

6 (a) Computing the color-matching matrix 'Mshabby' for the 'ShabbyTint' primaries works just basically like it did in question (2) (it really wouldn't, because paint mixing is not linear, in the sense that the reflectance function of a mixture of paints is not the weighted sum of the reflectance functions of the paints taken separately -- but pretend that it is!).

The only new twist is that the effective "primaries" for the paint, 'Pshabby', depend both on the reflectance function of the paint and also the lighting; thus in store it is

Pshabbyfluo = shabby .* [fluo, fluo, fluo];

and at home it will be

Pshabbyday = shabby .* [daylight , daylight , daylight ] ;

The actual spectrum of the light reflected from the couch will of course be

couch .* fluo

or

couch .* daylight

Equivalent expression are

diag(fluo)*couch

and

diag(daylight)*couch


6(b). To match under both lighting conditions, we want a paint mixture x such that
M*diag(fluo)*shabby*x = M*diag(fluo)*couch
and also
M*diag(daylight)*shabby*x = M*diag(daylight)*couch

Note that we are using 'M' here just to project the spectra down into the 3-dimensional color space in which we want the colors to match; it doesn't really matter which primaries (and thus which M) we use.

The expressions 'diag(fluo)*shabby*x', 'diag(fluo)*couch' etc. are just "lights" (i.e. sampled spectrums), and we want them to match by being projected into the same point in the psychophysical subspace - or into the closest possible points if no exact equivalence is possible.

We can combine the two matrix equations into one by stacking them up row-wise:

Let
MM = [M*diag(fluo) ; M*diag(daylight)];

Then we want to find x (a paint mixture) such that:

MM*shabby*x = MM*couch

MATLAB can solve equations of the form Ax = B using the \ operator.

To quote the documentation (from 'help mldivide'):

If A is an M-by-N matrix with M < or > N and B is a column
vector with M components, ...
then X = A\B is the solution in the least squares sense to the
under- or overdetermined system of equations A*X = B.

Hope this helps!