Reputation: 345
Let's say I have
A = [3 0 2; ...
0 0 1; ...
1 1 0]
A = sparse(A);
The output of which is below:
ans =
(1,1) 3
(3,1) 1
(3,2) 1
(1,3) 2
(2,3) 1
Question: is there an easy command to generate the following vector?
B = [1 1 3;3 1 1; 3 2 1; 1 3 2;2 3 1]
ans =
1 1 3
3 1 1
3 2 1
1 3 2
2 3 1
Upvotes: 0
Views: 56