function f = myode(t,y) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % function f = myode(t,y) % % This function is used to evaluate f(t,y)=y'(t) for the differential % equation of Problem 4, using the rates in global variable myrate. % % Dianne O'Leary 05/2006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% global myrate k = length(t); for i=1:k, f(i) = myrate(floor(t(i))+1)*y; end