Hi
This question has been probably raised but when i did searching on the community i got nil result (??) and some notification of community respect .So ,the thing is that when i have a list : {{a(t),b(t),c(t)},{a(t-1),b(t-1),c(t-1)},…{a(t-n),b(t-n),c(t-n)}} can i use “IF” to a(t) and check it against a(t-1) and if they are equal when sum “b” elements. ?Can it be recursively to the further pairs -- i.e. a(t-1) and a(t-2)…?
Do you want to add all the b(i) for which a(i) == a(t)? Or doe the sum stop at the first triple for which a(i) does not equal a(t)?
the second option
Split[list, (First[#1] == First[#2]) &] /. {_Integer, c_Integer, _Real} :> {c}
f = Flatten[Map[{Plus @@ #} &, %], 1] // Flatten
1 Can it be written more simply?
2. Can it be written with using “If”?