Identical random on two arrays

Hello!
I'm making a True/False-quiz during a MatLab course. My problem is, is that I have to make it able to take the questions in a random order. My questions and answers are stored in different cell array. So I have to make shuffle the order of the questions, but the answers has to be shuffled excatly as the questions. Is there a way to do that?
Thank you in advance

 Risposta accettata

Cedric
Cedric il 2 Mag 2014
Modificato: Cedric il 2 Mag 2014

5 voti

Use RANDPERM to generate an index vector, that you use then to index both cell arrays.

1 Commento

Kasper
Kasper il 2 Mag 2014
Thank you very much!
I then used sortedcellarray = cellarray(indexarray) for indexing my cell arrays so they match.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Random Number Generation in Centro assistenza e File Exchange

Richiesto:

il 2 Mag 2014

Commentato:

il 2 Mag 2014

Community Treasure Hunt

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

Start Hunting!

Translated by