getcontrolptloc.m
来自「Continuous Profile Models (CPM) Matlab T」· M 代码 · 共 30 行
M
30 行
% function [pts numCtrlPt] = getControlPtLoc(G,minNum,numCtrlPts)%% get location (in 'hidden' time) of control points% that we will use in the spline modelling of u_kt% for CPM2function [pts numCtrlPt] = getControlPtLoc(G,minNum,numCtrlPt)if ~exist('numCtrlPt') %% roughly how many we will have numCtrlPt=floor(G.numTaus*G.controlPointProp); %% sometimes for test data this will be too small numCtrlPt = max(numCtrlPt,minNum);endnumCtrlPt = max(numCtrlPt,minNum);%% want one at the first and last time point, and %% then evenly distributed in between:timeChunkSize = floor(G.numTaus/(numCtrlPt-1));pts = 1:timeChunkSize:G.numTaus;if pts(end)~=G.numTaus if G.numTaus-pts(end) >= timeChunkSize/2 pts = [pts G.numTaus]; else pts = [pts(1:(end-1)) G.numTaus]; endend
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?