A bit new to Julia so this might be a very basic question: I have a file with a 3 dimensional array (x,y,z), and I’d like to sum certain values from the z dimension to later on pull from and graph. For example, if my array is 30x40x10, and I want to sum values from 1:4 and 6 from the z dimension, I tried
sum(A, [1:4,6]) which didn’t work, and variations of it.
Also, would there be a more general way to write it not specifying the matrix? For example, if I have two matrices A and B with the same dimensions above (but different values in the array) and I want to sum the same positions as above (i.e. 1:4 and 6 of z-dimension), how do I write this “sum” command such that later on in my code I can just specify something like
A[:12, :35, sum], B[:17, :28, sum]?
Thanks for all help.