MATLAB: How to find multiply variable in matrix multiplication

matrix arraymatrix multiplication

function least_square;
x=[1 2 3 4 5];
y=[4;2;5;3;7];
n=numel(x);
for i=1:n
A(i,1)=1;
A(i,2)=x(i);
A(i,3)=x(i).^2;
end
we have matrix A(5×3) and matrix y(5×1) let a matrix a(3×1) satisfy Aa=y so any function or method to find matrix a?

Best Answer

a = A\y ;
Related Question