DrawFormattedText error using Psychtoolbox
이전 댓글 표시
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]);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image display and manipulation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!