% Fill in the gaps. 

function ????DIRfieldVectzd(fnct, It, Iy) %dir field vectorized. 
% HW for Diff Eqns by Dr. M. Sakalli
% fnct: RHS of first order DE function representing directin fields(think about it)
% It: time interval, tmin, tmax, 
% Iy: y interval of ymin and ymax to be enjoyed. 
% Example: 
%	fnt=@(v_ u_) v_.^2-u_.^2; 
%	yournameDIRfiledVectzd(fnt, [-2 2], [-4 4])
%

if (~diff(???)|~???(Iy))
	disp(sprintf('One of the intervals you entered is zero!, quiting'));
	return;
end
num=20;
xh=(It(2)-It(1))/num;      
	
yh=(????????)/num;
[xm, ????] = meshgrid(??????????,Iy(1):?????:Iy(2));
	
scalefactor=1/25*(It(end)-It(1));
slopes=????(xm,ym);
% Enter graph title as direction fileds of function .... 
subplot(2,2,1), imagesc(slopes); 
% Enter title "Slopes not normalized"
rr=sqrt(1+slopes.^2);
dxx=(1./rr)*scalefactor;
dyy=(slopes./??????)*scalefactor;
subplot(2,2,2), imagesc(dyy); %image like contour
% Enter title "Slopes normalized"
subplot(2,2,3), mesh(dyy);% 3d mesh view
axis tight
subplot(2,2,4), quiver(xm,ym,dxx,?????,0); % Here is the direction field
axis tight
hold on

disp(sprintf('Enter an interval of particular sltn I0 and IEnd, ie [2 3]'));
disp(sprintf('Note you must avoid discontinuities otherwise ade45 will go infinite loop'));
It=input('         It ='); 
disp(sprintf('Enter t0, IF IT doesnt return a plot enter cntC to return prompt line'));
t0=input('         t0='); 

% the point t0 willnot return a value. valid interval, 
[px,py]=ode45(fnct,It,t0);
plot(px,py,'r'); 
hold off
