Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Ordinary Least Squares Problem

1 回表示 (過去 30 日間)
Benjamin Nienhouse
Benjamin Nienhouse 2020 年 10 月 17 日
閉鎖済み: John D'Errico 2020 年 10 月 18 日
Hey guys, so I'm new to MATLAB and I got hung up on a particulat part of this problem part(c), if anyone has advice on any of the parts in this problem, that would be much appreaciated.
a. Create a row vector of 100 linearly spaced elements ranging from -10 to 10 and call it “x”.
b. Create a vector called y_original = m*x+b. (where: m = 2, b = -5)
c. Add white noise with an snr (signal-to-noise ratio) of 20 to the values of “y_original” and label this new vector “y_noise” (make sure y_original is not changed)
d. At this point, you now have realistic ‘x’ data and ‘y’ data. With this in mind, how could you re-arrange this data into a format such that you could use linear algebra to solve for the coefficients of the linear equation (m*x+b = y).
e. Set c = A\y. Make sure this is stored as a column vector.
f. What is the physical significance of these numbers?
g. Create a new vector called ‘y_predicted’ = A*c
h. Plot (x vs. y_noise) and (x vs. y_predicted).

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by