Re: [問題] 判斷點數的連續性已回收
clear,clc
V = [0 0 7 5 7 9 4 2 0 0 1 5 9 0 0 7 8 ];
s = V~=0;
temp=s(1);
count=1;
for i=2:size(V,2)
if s(i)==temp
count=count+1;
else
count=1;
end
temp=s(i);
buffer(i)=count;
end
idx=find(buffer==max(test));
output=zeros(1,size(V,2));
output(idx-max(buffer)+1:idx)=1;
output=V.*output;
--
-好管弦事-
A place about cello and music....
http://fnt72.blogspot.com/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.124.1.64
※ 編輯: kobenein 來自: 59.124.1.64 (05/23 15:53)
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):