%This script gets an initial condition from the user, then solves the ODE
%from t = 0 to t = tf (also acquired from the user). Finally, the result is
%plotted.

clear;

c = input('Please enter an initial condition: ');

tf = input('Please enter the final time (> 0): ');
while(tf <= 0)
    tf = input('Please enter the final time (> 0): ');
end

tNum = input('Please enter the number of divisions of the time interval (>= 1): ');
tNum = floor(tNum);
while(tNum < 1)
    tNum = input('Please enter the number of divisions of the time interval (>= 1): ');
end

[t, y] = ode45('yDot', 0:(tf / tNum):tf, c);

plot(t, y);