필터 지우기
필터 지우기

Randomization problem. Is it complicated?

조회 수: 1 (최근 30일)
LuS
LuS 2015년 11월 10일
댓글: LuS 2015년 11월 11일
Hi all,
A question regarding the randomization with Matlab: I have created a script where I have 12 images and 12 sounds, combined into 24 trials. 1-1 1-2 2-1 2-2 3-3 3-4 4-3 4-4 And so on.... The script works very well and no bugs with psychtoolbox.
Any idea of how to randomise those 24 trials while avoiding 2 consecutive trials? For instance, randomise and avoid 3-4 and 4-4 or 4-3 to occur one after the other.
Looking forward for an answer :-)
Many thanks!
  댓글 수: 1
Image Analyst
Image Analyst 2015년 11월 10일
What is your criteria for making sure one pair does not occur immediately after another pair? Why is image 4 and sound 3 not allowed to come after image 3 and sound 4? They're different images and sounds - nothing is consecutive.

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

채택된 답변

Walter Roberson
Walter Roberson 2015년 11월 11일
For something like this, the easiest way is to loop, generating potential orders, exiting the loop if the order is acceptable and otherwise continuing to loop.
  댓글 수: 1
LuS
LuS 2015년 11월 11일
Hi, Thank you very much for your reply.
Here is what I tried and it is nit working :(
For trial=1:24
trialN=24
T=repmat(1:trialN, 1,2);
Trand=T(randperm(length(T)));
for K=1:length(Trand);
imtool(images{K});
end

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image display and manipulation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by