% We are trying to find A that satisfies y(1) = 2 tspan = [0:.1:1]; beta = 2; % Define an initial A, try A = 1, then try A = 2, then A = 5 A = 1; alpha = -1; y0 = [alpha A]; [t,y] = ode45('f',tspan,y0); figure(1), plot(t,y(:,1),'r*-',tspan(1),alpha,'bs',tspan(end),beta, 'bo') % plot solution y set(gca,'FontSize',20)