From: ImageAnalyst on 19 Jan 2010 08:53 I've never seen it done this way before - the max going always from the first element out to the current element. I've only ever seen the max of the entire array, or the max of a window of a finite width, w, centered at an element location, and that window "slides" along the array. Are you sure you don't want to do the latter? If so, you can use imdilate() in the image processing toolbox to give the max in a window centered at a point (and the point "slides" along so you're getting nMax(i) as you want). Just making sure.........
From: Bruno Luong on 19 Jan 2010 09:24 Luna Moon <lunamoonmoon(a)gmail.com> wrote in message <375ff86d-0264-4b0d-941c-060826c9f9ce(a)v25g2000yqk.googlegroups.com>... > Sorry I didn't make it clear. > > nMax need to be a vector of max's at that point...so called running > max... > > for i=1:length(data); > nMax(i)=max(data(1:i)) > end; You might have 36 ways of doing this running max in this thread: http://www.mathworks.fr/matlabcentral/newsreader/view_thread/237000 Bruno
From: Luna Moon on 20 Jan 2010 16:52
On Jan 19, 9:24 am, "Bruno Luong" <b.lu...(a)fogale.findmycountry> wrote: > LunaMoon <lunamoonm...(a)gmail.com> wrote in message <375ff86d-0264-4b0d-941c-060826c9f...(a)v25g2000yqk.googlegroups.com>... > > Sorry I didn't make it clear. > > > nMax need to be a vector of max's at that point...so called running > > max... > > > for i=1:length(data); > > nMax(i)=max(data(1:i)) > > end; > > You might have 36 ways of doing this running max in this thread:http://www.mathworks.fr/matlabcentral/newsreader/view_thread/237000 > > Bruno Looks like people there favor the "for" loop solution? |