Math2601 P.
DharmTej(2024032316) Page 1 of 6
MATLAB Assignment 01
Solution for Problem 01
Math2601 [Link](2024032316) Page 2 of 6
Math2601 [Link](2024032316) Page 3 of 6
Description: In this section, a for loop is used to compute the summation of the
series up to N=4 terms. The resulting approximation is plotted over the domain (-pi/
2 to pi/2).
Linspace is used to generate random values between -pi/2 and pi/2
Math2601 [Link](2024032316) Page 4 of 6
Code :
Graph:
Math2601 [Link](2024032316) Page 5 of 6
Description: To visualize how the series converges, we manually calculate and
plot the cumulative sums for the rst four terms individually. These are overlaid on
the same graph along with the actual cos(x) function to demonstrate accuracy
improvement with each added term
Code:
fi
Math2601 [Link](2024032316) Page 6 of 6
Graph:
Observations and Conclusion
From the graphs obtained, we observe that:
1. Single Term: The rst term approximation (y=1) is only
accurate at x=0.
2. Convergence: As we add higher-order terms (2nd, 3rd, and
4th), the approximation "hugs" the true cosine curve more
tightly.
3. Range: Within the range [-pi/2, pi/2], the 4th-term
approximation is nearly indistinguishable from the true value of
cos(x), validating the Taylor Series formula for this domain.
fi