Re: [問題] 判斷點數的連續性已回收

看板MATLAB作者 (哈哈哈)時間14年前 (2011/05/23 15:33), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
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)
文章代碼(AID): #1DsWtWsF (MATLAB)
文章代碼(AID): #1DsWtWsF (MATLAB)