Login  Register

Re: getResult to Array gives NaN

Posted by Herbie on Oct 24, 2016; 3:36pm
URL: http://imagej.273.s1.nabble.com/getResult-to-Array-gives-NaN-tp5017460p5017461.html

Good day Matt,

you can't have strings and numerical values in the same array.

Therefore, you may convert the values to strings to end up with a pure
string array. If you like to read the values back from the string array,
you have to convert them from strings to numbers.

HTH

Herbie

:::::::::::::::::::::::::::::::::::::::::::::
Am 24.10.16 um 17:22 schrieb PEARSON Matthew:

> Hi all,
>
> I'm having a bit of an issue with taking values from the results
> table and putting them into an array.  The first column of the
> results table contains a string, the current images title stored as a
> variable such as "test.tif" all other columns contain numbers.  The
> results table displays fine but when i loop through using getResult
> to put all the table values into an array, when i print the resultant
> array (Array.print) the values from the first column containing
> strings are listed as NaN.  How can i correct this?  Ultimately when
> i use this array to produce the final results table the first column
> is then filled with NaN.
>
> Thanks for the help,
>
> Matt
>
>
> -- Matt Pearson Microscopy Facility MRC Human Genetics Unit Institute
> of Genetics and Molecular Medicine (IGMM) University of Edinburgh
> Crewe Road EH4 2XU
>
>
>
>
>
> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
>
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html