Questions on expression testing and manipulation through pattern matching and constructing efficient patterns.
0
votes
1answer
161 views
Count sublists which match pattern
I have a list which looks like this: data={{12,0},{0,0},{20,1},{0,0}, {0,-1}}. Now I would like to count the number of sublists which:
have both slots zero
the ...
-1
votes
2answers
136 views
Correct way to compare arrays and do conditional evaluations
I would like to compare two arrays a=:
and b=
and get:
using:
(b/.(b_?Positive->a+b))//MatrixForm
but this doesn't seem to work? Can ...