Mercurial > hg > camir-ismir2012
view toolboxes/bioakustik_tools/math/maxsum.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
line wrap: on
line source
function [startf,stopf,maxsofar]=maxsum(in) maxsofar=0; maxendinghere=0; startf=1; stopf=1; aktstartf=1; for i=1:length(in) if (maxendinghere+in(i) < 0) maxendinghere=0; aktstartf=i+1; else maxendinghere=maxendinghere+in(i); end if(maxendinghere > maxsofar) maxsofar=maxendinghere; stopf=i; startf=aktstartf; end end