Login  Register

Re: Importing array from text file

Posted by Albrecht Sigler on Dec 02, 2013; 3:41am
URL: http://imagej.273.s1.nabble.com/Importing-array-from-text-file-tp3697966p5005756.html

Hi Martin,

'xcoor' is an array.  Therefore, 'xcoor[n]' will be interpreted as a string in line 48:

    X =  xcoor[n] / 100 * Xfact -2;

Trying to divide the string by a number causes the error you described.  If however you have in your equation first a number, the numerical value of 'xcoor[n]' is being used (rather than the string itself), and your calculation should work as expected:

   X = 0.01 * xcoor[n] * Xfact -2;

best, Albrecht