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

📄 keypiontall.m

📁 自己编写的实现时间序列中的关建点搜索
💻 M
字号:
function [g,keypoint]=keypiontall(data,K,t)%function [ keyda1,keyda2,keydata ] = keypoint( data,m,n,t)%UNTITLED1 Summary of this function goes here%  Detailed explanation goes here%keyda1 存储夹角方法取得的关键点%keyda2 存储幅值方法取得的关键点%data is the time series data which you want to search key point%m is the threshold value of angle%n is the threshold value of amplitude%t is the time per sample-rate%keyda1(:,1)=data(:,1);[d,n]=size(data); %d 为行,n 为例for i=1:dfor j=2:n-1   %求斜率   a=[data(i,j)-data(i,j-1)]/t;   b=[data(i,j)-data(i,j+1)]/t;   if a*b==1       e(i)=pi/2;   else    c=(b-a)/(1-a*b);   e(j)=atan(c);    %计算出的夹角     endend    [f,ind]=sort(e); %夹角排序      g(i,:)=ind(1:K); end%hist [m,n]=hist(g,n-1);  % the m record the element's times[a,b]=size(m)for i=1:ainde(i)=sum(m(i,:));end[p,q]=sort(inde);keypoint=q(1:K);

⌨️ 快捷键说明

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