Skip to contents

Invert a diagonal matrix which is passed as a vector. If any elements are zero, set them to one.

Usage

diag_inverse(x)

Arguments

x

a numeric vector

Value

a diagonal matrix