MATLAB: How can delete matrix randomly

matrix

y =[1 2 0.075 0.100 0.000 1.000
2 3 0.080 0.110 0.000 1.000
2 4 0.090 0.180 0.000 1.000
3 9 0.040 0.040 0.000 1.000
4 5 0.040 0.040 0.000 1.000
1 6 0.110 0.110 0.000 1.000
5 14 0.090 0.120 0.000 1.000
6 7 0.080 0.110 0.000 1.000
6 8 0.110 0.110 0.000 1.000
7 9 0.110 0.110 0.000 1.000
7 10 0.080 0.110 0.000 1.000
8 12 0.040 0.040 0.000 1.000
1 11 0.110 0.110 0.000 1.000
11 12 0.090 0.120 0.000 1.000
11 13 0.080 0.110 0.000 1.000
13 14 0.040 0.040 0.000 1.000];
I have matrix y and I want to delete 3 rows randomly. To be like this.
How can I do?
y =[1 2 0.075 0.100 0.000 1.000
2 3 0.080 0.110 0.000 1.000
2 4 0.090 0.180 0.000 1.000
4 5 0.040 0.040 0.000 1.000
1 6 0.110 0.110 0.000 1.000
6 7 0.080 0.110 0.000 1.000
6 8 0.110 0.110 0.000 1.000
7 9 0.110 0.110 0.000 1.000
7 10 0.080 0.110 0.000 1.000
1 11 0.110 0.110 0.000 1.000
11 12 0.090 0.120 0.000 1.000
11 13 0.080 0.110 0.000 1.000
13 14 0.040 0.040 0.000 1.000];

Best Answer

Let y be your matrix:
[nx,ny] = size(y) ;
idx = randsample(1:nx,3) ;
y(idx,:) = []
Note that, yopu are deleting rows..not columns.