Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Not able to figure out for days - unexpected Psychtoolbox error

72 views
Skip to first unread message

Trevor Dubois

unread,
Mar 1, 2015, 10:43:43 AM3/1/15
to
Hi,

I have spent days trying to debug code which I have written and I cannot seem to figure it out. I'm wondering if you guys have any ideas (the coding is done with Psychtoolbox). The problem line and full code is below for reference. I have tried to make so many changes and this leads to program to get stuck. Now the program asks for demographic information and then exits the Psychtoolbox window with an error.

Thanks for the help

Victor

Problem line:

Screen(w, 'The information will now be flipped'); % the information will now be displayed on the screen

Code:

clc;
clear all;
close all;
%
% Screen('Preference', 'SuppressAllWarnings', 1); %Suppresses warning that can come up
% Screen('Preference', 'SkipSyncTests', 1); %This avoids the syncing test which might lead to crashes when
%developing program
%PP_num=input('Please write down your participant number'); %get the number of the participant
ListenChar(2);
TxtSize=25;
[w, ScreenRect,Width,Height] = SetupToolBox(1/2,0,128);
%the colour will be grey and this command starts up PTB
%monitor will be on default screen mode shown by the 0
%the screen size will be either full of part of the full screen size
%determined by the 1/2 numbers

Screen('TextFont',w, 'Times New Roman'); %Chooses Times New Roman Font
Screen('TextStyle', w, 2); %Chooses bold text which is represented by 3
Screen('TextSize',w, TxtSize);

%Collect demographic data from participants using psychtoolbox
P_data{1} = str2num(GetEchoString(w, 'Please write down your participant number', 10,0, [0 191 255], [128 128 128]));
P_data{2} = GetEchoString(w, 'Please write down your name', 10, 2*TxtSize, [0 191 255], [128 128 128]);
P_data{3} = str2num(GetEchoString(w, 'Please write down your age', 10, 4*TxtSize, [0 191 255], [128 128 128]));
P_data{4} = GetEchoString(w, 'Please write down whether your gender is M/F', 10, 6*TxtSize, [0 191 255], [128 128 128]);

% Record_Responses(PP_num,PP_name,age,gender); %this will record responses into Excel

%information telling participant to continue
DrawFormattedText(w, 'Please press the spacebar in order to continue on to the next page', 'center', round(Height*0.9), [0 0 225]);
Screen(w, 'The information will now be flipped'); % the information will now be displayed on the screen

[KeyIsDown, ~, KeyCode] = KbCheck; %this does a KbCheck to make sure no keys etc are pressed down

while -strcmp(KbName(KeyCode), 'space') %Force spacebar press
[KeyIsDown, ~, KeyCode] = KbCheck;
end

KbReleaseWait; %waits until all keys are released
WaitSecs(1);

Steven Lord

unread,
Mar 2, 2015, 9:37:26 AM3/2/15
to


"Trevor Dubois" <trevor....@gmail.com> wrote in message
news:mcvc32$167$1...@newscl01ah.mathworks.com...
> Hi,
>
> I have spent days trying to debug code which I have written and I cannot
> seem to figure it out. I'm wondering if you guys have any ideas (the
> coding is done with Psychtoolbox). The problem line and full code is below
> for reference. I have tried to make so many changes and this leads to
> program to get stuck. Now the program asks for demographic information and
> then exits the Psychtoolbox window with an error.

Psychtoolbox is not a MathWorks product, and I have never used it, so I'm
not sure what's wrong. I recommend you check the Bugs section of the
Psychophysics Toolbox website and/or post the full text of the error message
on their Forum:

http://psychtoolbox.org/

*snip*

--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

0 new messages