DrawFormattedText error using Psychtoolbox
Mostrar comentarios más antiguos
I'm trying to set up a simple test experiment using Psychtoolbox, but I can't even get past showing my 3-line instructions on the screen with DrawFormattedText. This is my code:
% Set up the screen
clear all
close all
Screen('Preference','SkipSyncTests',1);
[win,screenRect]=Screen('OpenWindow',0,[127 127 127],[100 100 1000 800]);
% Instructions
tstring=["Blabla.\nBlabla.\nBlabla."];
[nx,ny]=DrawFormattedText(win,tstring,'center','center',[0 0 0]);
Screen('Flip',win)
% Close experiment
pause(3)
sca
However, when I try to run it, I get this error:
Index exceeds the number of array elements (1).
Error in DrawFormattedText (line 276)
tstring = [ tstring(1:min(newlinepos)-1) repchar tstring(min(newlinepos)+2:end)];
Error in Experiment (line 17)
[nx,ny]=DrawFormattedText(win,tstring,'center','center',[0 0 0]);
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Image display and manipulation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!