Re: message 50001?
- To: mathgroup at smc.vnet.net
- Subject: [mg50021] Re: [mg50001] message 50001?
- From: Matthias.Bode at oppenheim.de
- Date: Thu, 12 Aug 2004 05:43:26 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello Rob,
try:
yourlst01 = {1, 2, 1, 6, 3, 2, 2, 6,1};
Count[lst01, Max[lst01]]
Out: 2
Best regards,
Matthias Bode
Sal. Oppenheim jr. & Cie. KGaA
Untermainanlage 1
D-60329 Frankfurt am Main
GERMANY
Tel.: +49(0)69 71 34 53 80
Mobile: +49(0)172 6 74 95 77
Fax: +49(0)69 71 34 95 380
E-mail: matthias.bode at oppenheim.de
Internet: http://www.oppenheim.de
-----Ursprüngliche Nachricht-----
Von: 1.156 [mailto:rob at pio-vere.com]
Gesendet: Mittwoch, 11. August 2004 11:53
An: mathgroup at smc.vnet.net
Betreff: [mg50001] message 50001?
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