Beginner Question - Recording Trial Number

Hello,

I'm trying to set up a way that I can record the trial number for an experiment, and to save the trial number in a text file (which I already have created the structure for). The subject will be reading sentences in the form of jpegs on the screen for several trials, and I want to record the trial number along with other data in that file.

Do I need to create a loop to do this? The number of trials will be no more than the number of jpeg images I have. What should I do?

Thanks in advance for any tips. I'm brand new to Psychtoolbox and any help is appreciated.
Gwen
Dear Gwen,
I'm not quite sure I understand your question. Do you already have a way to set up the trial that will be run?
If so, I assume that you run the trials by a loop indeed.
e.g.:
for p=1:number_of_trials % p is an arbitrary name, one every iteration through the loop its will value will increase by one, until number_of_trials is reached
% display trial p
% save data. You can use p as trial number here, along with other stuff you want to save.
disp(['trial number: ' num2str(p)])
end
(hope i didn't make any typos)
Is that roughly what you are looking for? Saving to a file you do with fopen, fprintf and fclose by the way.
If you're looking for something else, could you clarify?
Best,
Dee
On Wed, Mar 14, 2012 at 14:53, ghonchehayazi <ghonchehayazi@...> wrote:

Hello,

I'm trying to set up a way that I can record the trial number for an experiment, and to save the trial number in a text file (which I already have created the structure for). The subject will be reading sentences in the form of jpegs on the screen for several trials, and I want to record the trial number along with other data in that file.

Do I need to create a loop to do this? The number of trials will be no more than the number of jpeg images I have. What should I do?

Thanks in advance for any tips. I'm brand new to Psychtoolbox and any help is appreciated.
Gwen