Linear regression

Use MATLAB
• 1-calculate the first 100 iterations of ∑ 𝑖 ^2
𝑛
𝑖=1 =
𝑛(𝑛+1)(2𝑛+1)
6
Note i is from 1 to n and in front of sigma we have i
2
• 2- Estimate the value of π.
(Help; ∑
(−1)^𝑛
2𝑛+1

𝑛=0 =
𝜋
4
)
Note n is from 0 to ∞ and in front of sigma we have a fraction in top
( -1)^n and in the bottom of fraction we have 2n+1.