[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: isnan() in an oct file
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: isnan() in an oct file |
Date: |
Tue, 21 Apr 2015 10:37:20 -0400 |
On Thu, 2015-04-16 at 07:17 -0700, babelproofreader wrote:
> How does one check, in an oct file, that the result of some matrix
> multiplication produces real values in the resultant matrix
> and not NaN values,
Use the isnan() method of the array types or octave_value. It is
what the isnan function from the interpreter calls:
http://octave.sourceforge.net/doxygen/html/d3/dd5/classNDArray.html#a47bf50a40032e59e1570e6b4c6d7721e
http://octave.sourceforge.net/doxygen/html/de/ddd/mappers_8cc_source.html#l01400
> and how would this be reported, e.g. line number of code, to
> terminal?
Use the error() function, e.g.
http://hg.savannah.gnu.org/hgweb/octave/file/043dcb4da5fc/libinterp/corefcn/pinv.cc#l90
HTH,
- Jordi G. H.