I see this question: How do I divide matrix elements by column sums in MATLAB?
But additionally, I want to do the division only if the column sum (sum(A)
) is non-zero.
Will any of the listed methods there work, except for the loop-method as it is very slow for my matrix size?