Help in shuffle test data ?
1 次查看(过去 30 天)
显示 更早的评论
Hello ,
I need help in matlab , this sounds easy but i can not seem to find a solution , here is an example :
data = [1 0.1
2 0.2
3 0.3
4 0.4
5 0.5
6 0.6 ]
i want to shuffle the test data , i mean the first line become the third line and the third line becoms the forth line for examle , but the order in the line remaind the same
Here is an example of how i want the data to become :
data = [1 0.1
6 0.6
2 0.2
5 0.5
4 0.4
3 0.3 ]
is there a matlab function that allows me to do that , and thanks in advance .
0 个评论
采纳的回答
Peng Li
2020-4-9
"he first line become the third line and the third line becoms the forth line"
your example doesn't meet what you described.
I guess you want do a random shuffling of data by rows.
newData = data(randperm(6), :)
newData =
4.0000 0.4000
1.0000 0.1000
6.0000 0.6000
5.0000 0.5000
2.0000 0.2000
3.0000 0.3000
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!