Using Compound to match image/audio/written words

조회 수: 4 (최근 30일)
Laura Pizzato
Laura Pizzato 2017년 8월 9일
댓글: Walter Roberson 2017년 8월 9일
I'm using Psychtoolbox to built an experiment using stimuli from different modalities, grouped in different array( audio, image and written words). The item in the differents modalities has to be compound, cause 5 item will be inittialy presented and later recognized within a mixed sequence in all modalities:
I did this code
ImageList={imagelist.jpg}
wordList={words}
soundlist={soundlist.wav};
correctness=[1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2];
for k=1:38
compound{k,1}=wordList{k};
compound{k,2}=MyImages{k};
compound{k,3}=word{k};
end
randcompound= Shuffle(compound);
for k=1:38
randcompound{k,4}=correctness(k);
end
The compound works, but when I shuffle it in randcompound it mix everything.
Any suggestion?
  댓글 수: 1
Walter Roberson
Walter Roberson 2017년 8월 9일
Why not assign correctness before doing the Shuffle, so that it gets shuffled with everything else?

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2017년 8월 9일
ImageList={imagelist.jpg} %assumes imagelist is a struct array with field named 'jpg'
wordList={words}
soundlist={soundlist.wav}; %assumes soundlist is a struct array with field named 'wav'
Compound(:,1) = ImageList(:);
Compound(:,2) = wordList(:);
Compound(:,3) = soundlist(:);
Compound(:,4) = num2cell( correctness(:) );
ncomp = size(Compound, 1);
randidx = randperm(ncomp);
randcompound = compound(randidx, :);
  댓글 수: 2
Laura Pizzato
Laura Pizzato 2017년 8월 9일
It works because it mantain compound even with randomization, but It obviously mark as correct (correctness=1) only the top 5 array's compounds, e.g ant.jpg, ant.wav ant, whereas I have to mark as correct the 5 item randomly selected by the array. How could I face that?
Walter Roberson
Walter Roberson 2017년 8월 9일
ImageList={imagelist.jpg} %assumes imagelist is a struct array with field named 'jpg'
wordList={words}
soundlist={soundlist.wav}; %assumes soundlist is a struct array with field named 'wav'
Compound(:,1) = ImageList(:);
Compound(:,2) = wordList(:);
Compound(:,3) = soundlist(:);
ncomp = size(Compound, 1);
Compound(:,4) = num2cell( correctness(randperm(ncomp)) );
randidx = randperm(ncomp);
randcompound = compound(randidx, :);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by