This function iterates through each column of a numeric matrix. If a column contains only zero and positive values, or only zero and negative values, the absolute value of that column is taken. Otherwise, the column is returned as is.

take_abs_unsigned(m)

Arguments

m

A numeric matrix.

Value

A matrix with absolute values taken for unsigned columns.