I have an oddly shaped array (it is 100 by 100 by {1 or 3}, with the 1 or 3 being essentially random). I want to run a 'Do' loop on the first 2 dimensions of the array, but I only want to do the thing in the loop when I am at a member with three members in the last dimension. Is there a way to do this? I tried playing with things like If[Array[[i]][[j]][[3]]!=Null,t,f], but to no avail. At the end of the day, what I want is a way to write the following in Mathematica's language:
If Array[[i]][[j]][[3]] exists, then do expr, otherwise, do not do expr.
- If
Array[[i]][[j]][[3]]
exists, then do expr
Looking forward to any solutions/advice/ideas! Thanks!.