function m=prep_jacs(m)
%PREP_JACS 
%    
%     
%    
%    See also: 
%    
%    

%MAN_PAGE_BEGIN
%
%   @purpose	
%
%   @synopsys	m=prep_jacs(m)
%   @description  
%
%   @see 
%
%MAN_PAGE_END

% By Antoine Duchateau. All Rights Reserved.
% Written: 5/10/99

for i=1:get(m,'n_in'),
	ticks{i}=(m.scales{i}(1:end-1)+m.scales{i}(2:end))/2;
	grids{i}=[];
end

[grids{:}]=ndgrid(ticks{:});
vects = reshape(cat(3,grids{:}),[size(grids{1}(:),1) get(m,'n_in')]);

for i=1:size(vects,1),
	d(i,:) = jacob_inputs(m,vects(i,:));
end

for i=1:get(m,'n_in'),
	m.mapping.opt.dlookups{i} = reshape(d(:,i),size(grids{1}));
	m.mapping.opt.dscales = ticks;
end
