0
votes

I want to permute only columns of a sparse matrix in Matlab.

I can perform both row and column permutation via following command:

permutedSparseMatrix=sparseMatrix(rowPermutation, columnPermutation);
1
could you not just replace rowPermutation with the original indices [1,2,... (or more generically 1:size(sparseMatrix,1)) so the rows order is unchanged?RTL
or more simpily replace rowPermutation with a colon :RTL

1 Answers

1
votes

permutedSparseMatrix = sparseMatrix(:,columnPremutation)