I am trying to use matlab code to random a word chart. I want to random one line of the chart, not a single word. But I've checked the function like random (line 1: line 15), didn't find an appropiate code. Anyone could help on this? thanks.

댓글 수: 2

Mohammad Sami
Mohammad Sami 2020년 7월 15일
Would you be able to clarify your questions ? Perhaps you can give an example of what you are trying to do.
Dorris Yan
Dorris Yan 2020년 7월 15일
I am doing a 1-back task. I want to use the stimulus below. So this makes me need to random one line of these stimuli. Every stimulus will appear 5 times and once as a target. I got the idea of randon each single word by using code. But what if I want to random the work with other features, what should I do? Thank you for the help.

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

답변 (1개)

Adam Danz
Adam Danz 2020년 7월 15일
편집: Adam Danz 2020년 7월 16일

0 개 추천

Use random permutations.
Apply this example to your data.
words = ["A" "B" "C" "D" "E" "F" "G" "H"];
randIndex = randperm(numel(words));
words_randomized = words(randIndex);

댓글 수: 6

Dorris Yan
Dorris Yan 2020년 7월 20일
Just check. Do you mean first define each stimuli and its features as A B C...and then use word random function?
Adam Danz
Adam Danz 2020년 7월 20일
No, this is just an example of how to use randperm. You can apply this method to your data.
I don't understand how you'd like to randomize your table. If you can explain it again, I could help you apply this method to your data.
Dorris Yan
Dorris Yan 2020년 7월 21일
I want to conduct a 1-back task with the subjects pressing a button for immediate stimulus repetitions. All the stimulus are presented in a pseudo-random order. There are ten stimulus. Each one will be presented four times as non-targets in separate blocks segregated by stimulus type. In addition, each stimulus appeared once as a target. 4 catch trials will be presented as well to keep participants' attention.
Above is my task explanation. Can you please help with this? Thank you very much.
Adam Danz
Adam Danz 2020년 7월 21일
편집: Adam Danz 2020년 7월 21일
What section of that would you like help with?
If you don't know where to start, break it up into smaller steps.
Dorris Yan
Dorris Yan 2020년 7월 22일
Actually I will conduct the task via E-prime, but I have no idea of the random procedure. I've see some random function for letter and number. Can you please help? or give me some clues. Thanks.
words = 'droad, stoad, shreaf, gleaf, nasp, shasp, lorn, vorn, noad, shoad' % the words stimuli I want to use
A = words
picture = "pic1, pic2, pic 3, pic4" % the catch trial I would use
B = picture
stimuli = A + B % all the stimuli
sequence = char(ones(27, 2)); %there will be 2 blocks (5 times for each words, 1 as target), so it would be 27 X 2 char array
Adam Danz
Adam Danz 2020년 7월 22일
It's been a dozen or so years since I've set up an e-prime experiment. I've used cpp to set up and control experiments since there. So, if you're looking for help with e-prime you'll likely need to look elsewhere.
If you're trying to set up the conditions in Matlab, I can help you there but first you'll need to clearly define the specific problem you're tying to solve. For example, I have these variables [...] and am trying to do this specific action with the variables [...].

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

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

태그

질문:

2020년 7월 15일

댓글:

2020년 7월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by