Dear Friend
I have a calibration program which I am trying to run on Mac OS X using Matllab version 7
and PTB version 3.0.8 and flavor stable.A part of the code and the error message is as
follows.
setGuns = [];
nColourGuns = 3;
lumStep = 8; % this is the luminance increment. Can be coarse or fine. 8 works well.
for i = 1:nColourGuns
lumSteps = [0:lumStep:256];
[m, n] = size(lumSteps);
lumSteps(n) = lumSteps(n) - 1;
newClut = CLUT;
for j = 1:n
setGuns = zeroGuns;
setGuns(1, i) = lumSteps(j);
newClut(1,:) = setGuns;
fprintf(1,[ 'CLUT entry: ' int2str(setGuns) '\n']);
Screen(w,'LoadCLUT',newClut);
Screen(w, 'FillRect', setGuns);
SysBeep;
Screen(w,'DrawText','Read and enter luminance, then press keypad enter for next
luminance level', 250, 20, [200 200 200 ]);
correctVal = 0;
while KbCheck;end; % wait until any depressed keys are released.
while correctVal ~= 1
lumVals(j,(i-1)*3+1) = i;
lumVals(j,(i-1)*3+2) = setGuns(i);
lumVals(j,(i-1)*3+3) = str2num( Ask(w,'',[setGuns],[setGuns],'GetString') );
while KbCheck;end; % wait until any depressed keys are released.
% check if input value is correct
Screen(w,'DrawText','Entered value was:', 250, 40, [200 200 200 ]);
Screen(w,'DrawText',num2str(lumVals(j,(i-1)*3+3)), 280, 60, [200 200 200 ]);
Screen(w,'DrawText','Is this correct?', 250, 80, [200 200 200 ]);
Screen(w,'DrawText','Hit keypad enter again to continue, or hit keypad zero to
enter the correct luminace value', 250, 100, [200 200 200 ]);
[keyIsDown, secs, keyCode] = KbCheck;
while ~keyIsDown
[keyIsDown, secs, keyCode] = KbCheck;
end
keyNum = find(keyCode);
while KbCheck;end;
% check that the right keys were pressed, start again if not
if keyNum==88 %key number of keypay 'enter'
correctVal = 1;
elseif keyNum==98 % key number of keypay zero
correctVal = 0;
Screen(w, 'FillRect', setGuns);
Screen(w,'DrawText','Enter correct value, then press keypad enter', 250, 20, [200
200 200 ]);
end
FlushEvents('keyDown');
end
end %for
end %for
I am getting an error message saying
Error in ==> GetChar at 229
charValue = OSX_JAVA_GETCHAR.getChar;
Error in ==> GetString at 23
char=GetChar;
Error in ==> Ask at 81
reply=eval(replyFun);
Error in ==> measureRGBcolourGuns at 46
lumVals(j,(i-1)*3+3) = str2num( Ask(w,'',[setGuns],[setGuns],'GetString') );
Can anyone suggest me to fix the error. Any help would be appreciated.
Thanks and Regards
Rishi
I have a calibration program which I am trying to run on Mac OS X using Matllab version 7
and PTB version 3.0.8 and flavor stable.A part of the code and the error message is as
follows.
setGuns = [];
nColourGuns = 3;
lumStep = 8; % this is the luminance increment. Can be coarse or fine. 8 works well.
for i = 1:nColourGuns
lumSteps = [0:lumStep:256];
[m, n] = size(lumSteps);
lumSteps(n) = lumSteps(n) - 1;
newClut = CLUT;
for j = 1:n
setGuns = zeroGuns;
setGuns(1, i) = lumSteps(j);
newClut(1,:) = setGuns;
fprintf(1,[ 'CLUT entry: ' int2str(setGuns) '\n']);
Screen(w,'LoadCLUT',newClut);
Screen(w, 'FillRect', setGuns);
SysBeep;
Screen(w,'DrawText','Read and enter luminance, then press keypad enter for next
luminance level', 250, 20, [200 200 200 ]);
correctVal = 0;
while KbCheck;end; % wait until any depressed keys are released.
while correctVal ~= 1
lumVals(j,(i-1)*3+1) = i;
lumVals(j,(i-1)*3+2) = setGuns(i);
lumVals(j,(i-1)*3+3) = str2num( Ask(w,'',[setGuns],[setGuns],'GetString') );
while KbCheck;end; % wait until any depressed keys are released.
% check if input value is correct
Screen(w,'DrawText','Entered value was:', 250, 40, [200 200 200 ]);
Screen(w,'DrawText',num2str(lumVals(j,(i-1)*3+3)), 280, 60, [200 200 200 ]);
Screen(w,'DrawText','Is this correct?', 250, 80, [200 200 200 ]);
Screen(w,'DrawText','Hit keypad enter again to continue, or hit keypad zero to
enter the correct luminace value', 250, 100, [200 200 200 ]);
[keyIsDown, secs, keyCode] = KbCheck;
while ~keyIsDown
[keyIsDown, secs, keyCode] = KbCheck;
end
keyNum = find(keyCode);
while KbCheck;end;
% check that the right keys were pressed, start again if not
if keyNum==88 %key number of keypay 'enter'
correctVal = 1;
elseif keyNum==98 % key number of keypay zero
correctVal = 0;
Screen(w, 'FillRect', setGuns);
Screen(w,'DrawText','Enter correct value, then press keypad enter', 250, 20, [200
200 200 ]);
end
FlushEvents('keyDown');
end
end %for
end %for
I am getting an error message saying
Error in ==> GetChar at 229
charValue = OSX_JAVA_GETCHAR.getChar;
Error in ==> GetString at 23
char=GetChar;
Error in ==> Ask at 81
reply=eval(replyFun);
Error in ==> measureRGBcolourGuns at 46
lumVals(j,(i-1)*3+3) = str2num( Ask(w,'',[setGuns],[setGuns],'GetString') );
Can anyone suggest me to fix the error. Any help would be appreciated.
Thanks and Regards
Rishi