Message Boards Message Boards

0
|
5299 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Rewrite code

Posted 11 years ago
list = {100, 105, 103, 99, 106, 107, 104, 112, 106, 106, 100.5}
crossingList[list_, delta_] :=
First /@ Most@
   FixedPointList[# /. ({Shortest[a__],b___} /; (Abs[(((First@{a} - Last@{a})/First@{a})*100)] \[GreaterSlantEqual]
           delta) :> {Last@{a}, b}) &, list]
crossingList[list, 5]


Is possible to write a code less sophisticated than the above ?
POSTED BY: Artur Kotarski
POSTED BY: W. Craig Carter
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract