ํ•„ํ„ฐ ์ง€์šฐ๊ธฐ
ํ•„ํ„ฐ ์ง€์šฐ๊ธฐ

Computing error for solution to linear equation

์กฐํšŒ ์ˆ˜: 1 (์ตœ๊ทผ 30์ผ)
Tevin
Tevin 2022๋…„ 12์›” 19์ผ
ํŽธ์ง‘: John D'Errico 2023๋…„ 1์›” 8์ผ
I want to solve a linear equation Ax= b, using least-squares. I also need to find the error in the solution. I am not sure how to find the error.
Error is;
๐ธ=โ€–๐ด๐’™โˆ’๐’ƒโ€–^2 =ฮฃ๐œƒ๐‘–^2 where i is index counter
A=[2 0;3 1;4 3];
b=[2;3;4];
x= A\b;
I am not sure how to calculate the error. Can someone help me?

์ฑ„ํƒ๋œ ๋‹ต๋ณ€

Matt J
Matt J 2022๋…„ 12์›” 19์ผ
ํŽธ์ง‘: Matt J 2022๋…„ 12์›” 19์ผ
  ๋Œ“๊ธ€ ์ˆ˜: 3
Tevin
Tevin 2023๋…„ 1์›” 8์ผ
Should this actually be E=norm(A*x-b) without the square?
John D'Errico
John D'Errico 2023๋…„ 1์›” 8์ผ
ํŽธ์ง‘: John D'Errico 2023๋…„ 1์›” 8์ผ
NO, it should not be.
What was asked for? In your own question, you showed the norm(A*x-b) SQUARED. @Matt J gave you the square of the norm.
It can be whatever you want, but if you want something else, then it is you who needs to make the decision.

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์ถ”๊ฐ€ ๋‹ต๋ณ€ (0๊ฐœ)

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Operating on Diagonal Matrices์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

Community Treasure Hunt

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

Start Hunting!

Translated by