What's wrong with my code?
古いコメントを表示
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:

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 件のコメント
Walter Roberson
2019 年 12 月 30 日
I think you need to post the entire question.
The code you posted does not create any 3 x 2 or 3 x 3 matrix.
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
2020 年 1 月 2 日
('och' is Swedish for 'and')
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!