Learn R Programming

PopED (version 0.3.2)

test_for_max: Test if any matrix element is above a max value.

Description

Function tests is any matrix element is above a maximum value. For those elements the function sets those values to the maximum value.

Usage

test_for_max(mat, max_mat)

Arguments

mat

A matrix.

max_mat

A matrix the same size as mat with the maximum allowed value of that element.

Value

A matrix

See Also

Other matrix_manipulation: diag_matlab, test_for_min, test_for_zeros

Examples

Run this code
# NOT RUN {
test_for_max(cbind(2,3,4,5,6),cbind(4,4,4,4,4))

test_for_max(ones(6)*45,ones(6)*40)



# }

Run the code above in your browser using DataLab