Kaylene - if I run your code, I notice that your Y array output from euler are all NaNs. Looking closely at this function
function[T,Y] = euler(f,a,b,ya,h)
a = 0; b = 1;
T = a:h:b;
Y = zeros(1,length(T));
Y(2) = ya;
for k = 1 : length(T)-1
Y(k+1) = Y(k) + h*f(T(k),Y(k));
end
the a and b inputs are overwritten with 0 and 1 respectively. Why? If I remove these initializations and change the initial value for Y (so Y(1) and not Y(2)) then the code becomes
function[T,Y] = euler(f,a,b,ya,h)
T = a:h:b;
Y = zeros(1,length(T));
Y(1) = ya;
for k = 1 : length(T)-1
Y(k+1) = Y(k) + h*f(T(k),Y(k));
end
which (at least) initializes Y to be something that can be drawn to your figure. The output using the different step sizes appears to be near identical which may not be what you are trying to show.