Math 238 MATLAB Project 2
Due: April 8, 2021
Instructions:
You can work on this project in a group of up to 3 members. Each group only needs to submit one report by the deadline. Please make sure that all the group members are listed in the document. Please submit the report in PDF format.
Please download and extract Project2.zip in the MATLAB Projects folder. There are 3 m-files in it. You should modify and use them to get the answers to each of the questions in this project. Please also include the input and output of the MATLAB codes in your report.
In MATLAB, we can create a loop if we want to execute a command for multiple times. A for loop in MATLAB is given below. Please explain what this loop does.
n = 10;
x = zeros(1,n);
for i = 1:n
x(i) = i^2;
end
(b) Consider the differential equation dy/dx = x + y, y(0) = 1. The exact solution is y = 2e^x - x - 1. Please modify Project2_Q1.m to approximate the solution on the interval [0, 0.5] using Euler's method with h = 0.05, and h = 0.005 respectively.