MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   行的随机顺序Matlab (https://www.labfans.com/bbs/showthread.php?t=26717)

poster 2019-12-14 20:46

行的随机顺序Matlab
 
假设我们有一个尺寸为100x3的矩阵

您将如何在MATLAB中随机排列行?



[B]回答:[/B]

要随机排列矩阵的行,可以使用[URL="http://www.mathworks.com/help/techdoc/ref/randperm.html"]RANDPERM[/URL]

shuffledArray = orderedArray(randperm(size(orderedArray,1)),:); randperm将生成的列表N随机值以及对它们进行排序,并返回的第二输出sort作为结果。



[url=https://stackoverflow.com/questions/5444248]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:22

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.