Jak wyznaczyć aproksymację średniokwadratową wielomianem drugiego stopnia dla takich punktów?
\(\displaystyle{ \begin{array}{c|c|c|c}
x & -1 & 0 & 1 \\
\hline
y & -2 & 0 & 1
\end{array}}\)
Aproksymacja średniokwadratowa
Aproksymacja średniokwadratowa
Ostatnio zmieniony 3 lip 2019, o 16:15 przez Jan Kraszewski, łącznie zmieniany 1 raz.
Powód: Brak LaTeX-a. Proszę zapoznaj się z instrukcją: http://matematyka.pl/latex.htm .
Powód: Brak LaTeX-a. Proszę zapoznaj się z instrukcją: http://matematyka.pl/latex.htm .
-
- Użytkownik
- Posty: 7917
- Rejestracja: 18 mar 2009, o 16:24
- Płeć: Mężczyzna
- Podziękował: 30 razy
- Pomógł: 1671 razy
Aproksymacja średniokwadratowa
\(\displaystyle{ f(x) = a x^2 +b x + c.}\)
Na podstawie tabelki:
\(\displaystyle{ \begin{cases}-2 = a - b +c \\ 0 = c \\ 1 = a +b + c \end{cases}}\)
\(\displaystyle{ \left[\begin{matrix}1 & -1 & 1 \\ 0 & 0 & 1 \\ 1 & 1 & 1\end{matrix}\right] \left[ \begin{matrix}a \\ b \\ c \end{matrix}\right] = \left[ \begin{matrix}-2 \\ 0 \\ 1 \end{matrix}\right]}\)
OCTAVE 4.2.1.
\(\displaystyle{ f(x) = -0,5 x^2 +1.5 x.}\)
Na podstawie tabelki:
\(\displaystyle{ \begin{cases}-2 = a - b +c \\ 0 = c \\ 1 = a +b + c \end{cases}}\)
\(\displaystyle{ \left[\begin{matrix}1 & -1 & 1 \\ 0 & 0 & 1 \\ 1 & 1 & 1\end{matrix}\right] \left[ \begin{matrix}a \\ b \\ c \end{matrix}\right] = \left[ \begin{matrix}-2 \\ 0 \\ 1 \end{matrix}\right]}\)
OCTAVE 4.2.1.
Kod: Zaznacz cały
>> A =[1,-1,1;0,0,1;1,1,1]
A =
1 -1 1
0 0 1
1 1 1
>> b =[-2,0,1]'
b =
-2
0
1
>> A^-1*b
ans =
-0.50000
1.50000
0.00000