Thank you John.
I ended up implementing my own quick and dirty approach that works for the purposes that I need it for. It's pasted below.
function EvenSamplingOfFunction(minx,delx,maxx,DS)
x = minx:delx:maxx;
x2 = minxdelx/2:delx:maxx+delx/2; %just a shifted version
Nx = size(x,2);
Nx2 = size(x2,2);
y = myfun(x);
y2 = myfun(x2);
%Diffy=gradient(y)/delx;
Diffy=diff(y2)/delx;
% Dy=1./x.^2; %ITS DERIVATIVE
% figure;
% hold on;
% plot(x,Dy,'k','Linewidth',5)
% plot(x,abs(Diffy),'color','r','Linewidth',5)
% pause;
S(1) = 0;
counter = 1;
xsample(counter)=minx;
for nx=2:Nx
dS=delx*sqrt(1+Diffy(nx)^2);
S(nx)=S(nx1)+dS;
if S(nx)>counter*DS
counter=counter+1;
xsample(counter)=x(nx);
end
end
ysample = myfun(xsample);
figure;
hold on;
plot(x,y,'k','Linewidth',5)
plot(xsample,ysample,'o','Color','r','Linewidth',5)
xsample
function F1 = myfun(xdata)
F1 = 1./xdata; %PUT ANY FUNCTION HERE
%F1 = 5*exp(xdata); %PUT ANY FUNCTION HERE
%F1 = xdata.^2; %PUT ANY FUNCTION HERE
%F1 = 5*sin(xdata); %PUT ANY FUNCTION HERE
