SCM

SCM Repository

[batman] View of /SplineFitBATMAN_MATLABcode/intersectSpecSpline.m
ViewVC logotype

View of /SplineFitBATMAN_MATLABcode/intersectSpecSpline.m

Parent Directory Parent Directory | Revision Log Revision Log


Revision 346 - (download) (annotate)
Tue Nov 11 03:01:17 2014 UTC (2 years, 9 months ago) by jie
File size: 637 byte(s)
matlab
function ppmx = intersectSpecSpline(Xn, offset, x, y, ppm, minflag, ppmerror)
% written 120213 Dr. Jie Hao, Imperial College London

[n,m]=size(Xn);
offy=[0:n-1].*offset;
 off = repmat(offy',1,m);
D = Xn + off;
[y iy]=sort(y);
x=x(iy);

% ppmx = zeros(2,size(D,1));
ppmx = intersectSpecSplineRatio(Xn, offset, x, y, ppm);
for i = 1:size(ppmx,2)
    ind = find(ppm>=ppmx(1,i)-ppmerror & ppm<= ppmx(1,i)+ppmerror);
    if (~isempty(ind))
        if minflag
            [ny, nyi] = min(D(i,ind));
        else
            [ny, nyi] = max(D(i,ind));
        end
        
        ppmx(1,i) = ppm(ind(nyi));
        ppmx(2,i) = ny;
    end
end

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge