Reputation: 3
Hey i have a matrix A 3x3..
A= [1 2 3 4 2 3 4 5 3 4 5 6]
I want with randperm to generate a new matrix B where the columns will be shuflled..Anyone can help?
Upvotes: 0
Views: 2358
Reputation: 29081
You can use randperm like this:
randperm
B = A(:, randperm(size(A,2)))
Upvotes: 3