www.pudn.com > level_set_methods_1.1.zip > der_ENO1_minus.m, change:2005-05-05,size:624b


function [data_x] = der_ENO1_minus(data, dx) 
% 
% Calculates the derivative (minus) using 
% first order accurate ENO scheme 
% takes 1-D data 
% data: input data 
% dx: grid resolution 
% Note: before entering this function, data needs to be  
% extended by 1 at the beginning and end (values don't matter) 
% 
% Author: Baris Sumengen  sumengen@ece.ucsb.edu 
% http://vision.ece.ucsb.edu/~sumengen/ 
% 
 
 
data_x = zeros(size(data)); 
 
% extrapolate the beginning and end points of data 
data(1) = 2*data(2)-data(3); 
data(end) = 2*data(end-1)-data(end-2); 
 
data_x(2:end-1) = (data(2:end-1)-data(1:end-2))/dx;