Divide the matrix randomly, based on columns
조회 수: 1(최근 30일)
표시 이전 댓글
You mean like this?
fractions=[70 15 15];
x=rand(78000,100);%use 100 to show the split is indeed 75:15:15
L= r>f(n) & r<=f(n+1);
댓글 수: 2
Because randperm is generating the indices, this is guaranteed not to result in overlapping groups. Unless there are columns in your data that are equal to eachother, there is not be any match between the groups.
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!