Using Matlab:

3. (8 pts) During Classes 27 and 28 you learned how to implement the Euler Method in MATLAB. Create a MATLAB function (not a

3. (8 pts) During Classes 27 and 28 you learned how to implement the Euler Method in MATLAB. Create a MATLAB function (not a script as we created in class) called feuler(func,yo,tf,delt) that will use the Euler Method to integrate any function y(t). The user shall provide the function handle (func), the initial value (yo), the final time (tf), and the time step (delt). a. (6 pts) Use your feuler function to integrate the following function, documenting your result with screen shots (Snipping Tool). Use an initial value of 5, a final time of 4, and a time step of 0.1. dy = 2/ų – t b. (1 pt) What is the final y-value at t = 4? C. (1 pt) Plot y as a function of t for your result from part (a).



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *