필터 지우기
필터 지우기

What's wrong with my code?

조회 수: 1 (최근 30일)
Jenny Andersen
Jenny Andersen 2019년 12월 30일
댓글: Rik 2020년 1월 2일
Hi! So I am trying to solve x for M = A^T A och d = A^T b but according to my teacher I should recieve a 3*3 matrix and not a 3*2 matrix. I really don't know what's wrong about my code.
Here are the matrices A and B:
Skärmavbild 2019-12-30 kl. 11.58.10.png
And here is my code:
A = [1 1; 1 2; 1 3; 1 4]
b = [0;3;5;6]
M = A.' *A
d = A.' *b
x = M\d;
disp(x)
Can you see what's wrong?
  댓글 수: 3
Athul Prakash
Athul Prakash 2020년 1월 2일
Kindly post the quesiton in full. The code you gave outputs a 2x1 matrix in 'x' - I couldn't understand what is required instead. Also, what is 'och' in this case?
Rik
Rik 2020년 1월 2일
('och' is Swedish for 'and')

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

답변 (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