Adding a New Data Column from logfile to excel

36 views
Skip to first unread message

Keydy Mendez

unread,
Mar 24, 2023, 2:29:04 PM3/24/23
to FEDforum
Hello all! 
       We are currently working on an experiment with FED 3 in a food deprivation model (in random feeding). The parameters of the timeout duration we added would be between 0 and 30 minutes. I am currently having trouble figuring out how to change the log file so that it records the random timeout parameters we set. What I did was add random(Timeout) to the log while where it indicates: 

logfile.println(random(Timeout))

We also added (logging random timeout)
logfile.print(random(0,60));
logfile.print(","); 

Although a new column in excel is being generated, it is not recording the correct data in regard to the timeout that is generated on the FED for our free feeding model. 

Any help would be appreciated! Thanks

Lex

unread,
Mar 24, 2023, 6:36:35 PM3/24/23
to Keydy Mendez, FEDforum
Hi Keydy,
I think the issue is that you're generating a random number to control the length of the timeout in your code, and then you're re-generating a *new* random number when you log data with:
logfile.print(random(0,60));

Each time you call the random function you'll get a different random number, so the random number you used to control the timeout is not the same as the random number in your call to log data.  To fix this, you need to call the random function once and store the number it returns in a variable.  And then use that variable to both control your timeout and log in the logfile. 

Best,
-Lex

--
You received this message because you are subscribed to the Google Groups "FEDforum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fedforum+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fedforum/26c746e8-52ee-47d7-8528-cc87f228c9fbn%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages