⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makesegs.m

📁 matlab下实现kaplan算法
💻 M
字号:
function startends = makesegs(times,seglength,overlap,nsegs,startskip)% startends = makesegs(times,seglength,segskip)% create a list of start and end times for use in % <segment>.  This makes all segments the same length,% and they can overlap (or if overlap is negative, skip)% if <nsegs> is specified, only the first nsegs segments will be created% <startskip> skips the first part of the dataif nargin < 5 startskip = 0;endif nargin < 4 % keep all the segments nsegs = -1; endif nargin < 3  overlap = 0;endfirst=min(times)+startskip;last = max(times)-seglength;starts = (first:(seglength-overlap):last)';ends = starts + seglength;startends=[starts,ends];if length(startends) == 0  startends = [min(times)+startskip, max(times)];  warning('Data too short for a full-length segment.  Creating a short segment.')endif nsegs >= 0  startends = startends(1:(min(length(starts),nsegs)),:);end

⌨️ 快捷键说明

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