使用 MATLAB 随机配对两个变量

Use MATLAB to randomly pair two variables

我希望使用 MATLAB 将数字随机分配给变量列表。变量代表实验中使用的视频剪辑。我想随机排列剪辑的顺序,所以我想将每个剪辑与例如数字 1-15 配对,而不重复。

有什么想法吗?

如果将剪辑放入数组中,则可以使用 randperm 来随机播放它们。例如:

clips = [clip1, clip2, ..., clip15]
shuffle = randperm(length(clips))
randomized_clips = clips(shuffle)