필터 지우기
필터 지우기

least square solution of linear system of equations

조회 수: 1 (최근 30일)
Dung Tran Hoang
Dung Tran Hoang 2020년 4월 22일
답변: Johannes Hougaard 2020년 4월 22일
i have homework about least square solution that i have a linear system of equation
x1 + x2 + x3 = 4
-2x1 + 2x2 + x3 = 6
x1 + x2 - 2x3 = 6
anyone know how to find least square solution of the least square solution in matlab?
(answer output must be in vector form(x1,x2,x3))

채택된 답변

Johannes Hougaard
Johannes Hougaard 2020년 4월 22일
Although you should do your homework yourself I think I can help you : )
This problem could be solved with the backslash operator (or mldivide)
X = [1 1 1
-2 2 1
1 1 -2]; % These are the coefficients from your linear system
Y = [4
6
6]; % these are the responses from your linear system
P = X\Y; % and P' would be your [x1,x2,x3]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by