check for infinite entries
r=isinf(x)
:x real or complex vector or matrix r : boolean vector or matrix :
isinf(x) returns a boolean vector or matrix which contains true entries corresponding with infinite x entries and false entries corresponding with finite x entries.
isinf([1 0.01 -%inf %inf])