bg.m

来自「Basic function to locate and measure the」· M 代码 · 共 37 行

M
37
字号
function findpeakslider6(n,h)
% Called when the BG slider is clicked.

global x
global y
global SlopeThreshold 
global AmpThreshold  
global SmoothWidth
global FitWidth
global P
global PeakNumber

warning off MATLAB:divideByZero

BaselinePoints=5;  % Change as you wish

% Acquire background points from user mouse clicks
title(['Click on ' num2str(BaselinePoints) ' points on the baseline between the peaks.'])
X=[];Y=[];
for g=1:BaselinePoints;
   [clickX,clickY] = GINPUT(1);
   X(g)=clickX;
   Y(g)=clickY;
   xlabel(['Baseline point '  num2str(g) ])
end
yy=y;
for k=1:length(X)-1,
   fp=val2ind(x,X(k));
   lp=val2ind(x,X(k+1));
   yy(fp:lp)=y(fp:lp)-((Y(k+1)-Y(k))/(X(k+1)-X(k))*(x(fp:lp)-X(k))+Y(k));
end
y=yy;
if PeakNumber==0,
    P=findpeakslidersRedraw(x,y,SlopeThreshold,AmpThreshold,SmoothWidth,FitWidth);
else
    RedrawPeak
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?