Compute A 2d Array Of Intensity Values Matlab