I'm working on a project where the following has to be solved on a regular basis, as new column vectors are added to the matrix X.(adsbygoogle = window.adsbygoogle || []).push({});

a=x' * inv (X * X') * X

where

mis the number of examples

dis the dimensionality of the vector x

xisdx 1 and norm2(x) <= 1

X isdxm, consisting ofm"x" vectors arrangedcolumn-wise(not row-wise as is typically the case)

and

a should bemx 1

I'm wondering is there a faster way to calculate in Matlab, other than a direct implementation of the above. It's not an equation in the usual form Xw = y, so the built-in solver won't work. I'm wondering are there any decompositions that might help, but bear in mind that the equation is solved, then X is changed, then we return to solve the equation once more for a different x.

Thanks

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB Help solving an eqn in Matlab

**Physics Forums | Science Articles, Homework Help, Discussion**