Write a function file in matlab that utilizes Euler’s method to solve the following differential equation to within 10 -6 tolerance of the exact value. dy(x)/dx+2y(x)=4 y(0)=3 Solution function dy = pendode(t,y) % Parameters g=9.81; l=1; % Differential Equations dy=zeros(2,1) dy(1)=y(2); dy(2)=-(g/l)*sin(y(1)); 13 In addition to this function M- le, we write an events function M- le pendevent.m that speci es the event we are looking for. % Glenn Lahodny Jr. % Math 442 - Mathematical Modeling % This function defines the event that our pendulum reaches its % center point from the right. function [lookfor stop direction] = pendevent(t,x) % Searches for this expression set to 0. lookfor=y(1); % Stops when the event is located. stop=1; % Specifies the direction of motion at the event. direction=-1; .