使用函式randperm()即可實現。 例:a = [7,6,3,9,10]; % 試驗矩陣【用於試驗,矩陣元素為待隨機排列的資料】. randindex_a = randperm(5); % 生成1到5 ...
確定! 回上一頁