?? getidm.m
字號:
function [IDM,ipcpdata]=getidm(pcpdata,flag)
m=size(pcpdata,2);
n=m-1;
ipcpdata=zeros(2,n);
for i=1:n
h=30;
for j=1:12
pr=rotateright(pcpdata(:,i+1),2*(j-1));
hj=cosdist(pcpdata(:,i),pr);
if hj<h
h=hj;
index=j;
end
end
ipcpdata(1,i)=index/12;%index from 1:12
ipcpdata(2,i)=h;
end
IDM=zeros(n,n);
max=0;
for i=1:n
for j=i:n
IDM(i,j)=cosdist(ipcpdata(:,i),ipcpdata(:,j));
if IDM(i,j)>max
max=IDM(i,j);
end
end
end
IDM=IDM/max;
for i=1:n
for j=1:i-1
IDM(i,j)=IDM(j,i);
end
end
if nargin==2
if flag=='plot';
imagesc(1-IDM);
colormap(gray);
colorbar;
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -