how to find multiply variable in matrix multiplication

조회 수: 1 (최근 30일)
Vishal Rajpurohit
Vishal Rajpurohit 2018년 5월 29일
댓글: Vishal Rajpurohit 2018년 5월 29일
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(5x3) and matrix y(5x1) let a matrix a(3x1) satisfy Aa=y so any function or method to find matrix a?
  댓글 수: 3
Stephen23
Stephen23 2018년 5월 29일
@Vishal Rajpurohit: Note that the output matrix A should be preallocated:
Vishal Rajpurohit
Vishal Rajpurohit 2018년 5월 29일
thankyou sir

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2018년 5월 29일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by