[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem : loading external list
From: |
Emilie04 |
Subject: |
Problem : loading external list |
Date: |
Fri, 7 Dec 2012 09:46:52 -0800 (PST) |
Hello everybody,
My script functions perfectly on MATLAB, but in my lab, I have to test on
Octave. So I transform my script for that it's conform to Octave (the
difference is only, I think, the command to load external lists).
The script runs at the beginning, but when it arrives at the moment where it
has to load the file in .txt, nothing happens (in bold in the script
beside).
Here, this is a part of my script. Have you an idea of what is
dysfunctioning? Thank you very much
w=Screen('OpenWindow', 0);
cycleRefresh=Screen('GetFlipInterval', w);
HideCursor
[width, height]=Screen('WindowSize', w);
%% ETAPE 2: INSTRUCTIONS
instruction=imread('Instruction1.jpg');
Screen(w, 'FillRect', [255, 255, 255])
Screen('Putimage', w, instruction)
Screen(w, 'Flip')
[secs, keyCode, deltaSecs]=KbWait
WaitSecs(0.3)
%% ETAPE 4 : IMPORTATION DES FICHIERS
*items=[];
fid = fopen('horlogealea.txt');
while ~feof(fid)
temp=sscanf(fgetl(fid), '%s');
items=[items;temp];
temp=[];
end
fclose(fid);
items = cellstr(items);*
nItems=length(items); % spécifie la longueur de la liste
tex=zeros(1,nItems);% Textures
Order=randi(length(items)):length(items) % Premier stimulus aléatoire, puis
suite de la liste
*stimuli=[];
fid = fopen('horloge.txt');
while ~feof(fid)
temp=sscanf(fgetl(fid), '%s');
stimuli=[stimuli;temp];
temp=[];
end
fclose(fid);
stimuli = cellstr(stimuli);*
nStim=length(stimuli);
texstim=zeros(1,nStim);
vbl=Screen(w, 'Flip');
%% ETAPE 5 : HORLOGE AL»ATOIRE
for g=Order
img=imread(items{g});
tex(g)=Screen('MakeTexture', w, img); %Faire les textures
Screen('drawtexture', w, tex(g))
vbl=Screen(w, 'Flip', vbl+(2.5*cycleRefresh));
KbCheck;
end
...
--
View this message in context:
http://octave.1599824.n4.nabble.com/Problem-loading-external-list-tp4647632.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Problem : loading external list,
Emilie04 <=