我正在设置一个实验,让成对的单词以随机的顺序闪现在屏幕上。我有一个配对单词的单元格数组,并且我使用my来显示这些单词。我一直收到错误消息。
我使用大括号,并尝试引用单词的位置,但它永远不会单词,除非我硬编码我想要出现的单词,这不会起作用,因为我希望单词在实验中以随机顺序出现。
%这是我的数组设置:
Word1 = {'shaky'; 'salty'; 'dizzy'; 'ideal'; 'jogging'; 'sweater';
'brainstorming'; 'weightlifting'};
Word2 = {'easel'; 'shaky'; 'lofty'; 'dizzy'; 'whistle'; 'jogging';
'weightlifting'; 'sportsmanship'};
DotSpot = { 'top'; 'top'; 'bottom'; 'bottom'; 'top'; 'top'; 'bottom';
'bottom'};
Target = { 'fall'; 'fall';
'fall';'fall';'active';'active';'active';'active'};
Category = { 'congruent';'incongruent'; 'incongruent';
'congruent';'congruent';'incongruent'; 'incongruent'; 'congruent'};
StimList = table(Word1, Word2, DotSpot, Target, Category);这是我的屏幕设置:
CompScreen = get(0,'ScreenSize'); % Find out the size of this computer
screen
win = Screen('OpenWindow',0, CompScreen); %[900 900 1000],
white=WhiteIndex(win);
Screen('FillRect', win, white);
Screen('TextSize',win, 30);
Screen('TextFont',win, 'Courier New');
Screen('TextStyle', win, 1);%这里是我现在尝试只显示一个单词的地方,但一切都出错了:
Screen('DrawText', win, StimList{1,1} , 500, 500, [0, 0, 0]);
Screen(win, 'Flip');
WaitSecs(.5);
KbWait;sca;
发布于 2019-06-14 23:06:12
屏幕'DrawText‘函数需要一个字符串,但在您的示例中,您为它提供了一个包含字符串的单元格数组。在单元格数组中进一步索引一个级别将返回DrawText所期望的字符串:
Screen('DrawText', win, StimList{1,1}{:} , 500, 500, [0, 0, 0]);https://stackoverflow.com/questions/56587002
复制相似问题