Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: message 50001?

  • To: mathgroup at
  • Subject: [mg50038] Re: message 50001?
  • From: kzhang at (Kezhao Zhang)
  • Date: Thu, 12 Aug 2004 05:44:07 -0400 (EDT)
  • References: <cfcqbg$42j$>
  • Sender: owner-wri-mathgroup at

"1.156" <rob at> wrote in message news:<cfcqbg$42j$1 at>...
> Mathematica wizards, I've managed to cripple together code to do something that 
> I feel must be doable more easily and/or faster.
> S is a list of reals containing a signal with a prominent peak in 
> amplitude. I simply want to find the index of the peak (x, the number of 
> entries into the list where the peak occurs). Here's what I did.
> For[i = 1, S[[i]] ? max[S], i++, x = i];
> Can some suggest a better way, especially one not using a For loop?
> Thanks, Rob

How about the following



Position[S, Max[S]]

K. Z.

  • Prev by Date: Re: How to set linewidth in 3-D graphics?
  • Next by Date: Re: message 50001?
  • Previous by thread: Re: message 50001?
  • Next by thread: Re: message 50001?