MATLAB Answers

How to random a chart?

2 views (last 30 days)
Dorris Yan
Dorris Yan on 15 Jul 2020
Commented: Adam Danz on 22 Jul 2020
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.
Dorris Yan
Dorris Yan on 15 Jul 2020
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.

Sign in to comment.

Answers (1)

Adam Danz
Adam Danz on 15 Jul 2020
Edited: Adam Danz on 16 Jul 2020
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);
Adam Danz
Adam Danz on 22 Jul 2020
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 [...].

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!