How do I obtain the original mapping after performing SYMRCM in MATLAB 7.1(R14SP3)?

1 view (last 30 days)
I have written the following MATLAB code to perform inverse mapping using the SYMRCM function:
B = bucky; %original matrix
subplot(1,2,1), spy(B), title('B');
p = symrcm(B);
R = B(p,p); %matrix after SYMRCM
I want to obtain the mapping from B to R.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Jan 2010
To obtain the original matrix after executing the SYMRCM function in MATLAB 7.1 (R14SP3) obtain the reverse mapping from the result of the SYMRCM function and apply it to the matrix generated from the result of the SYMRCM function.
Please refer the code below in MATLAB, in order to perform this operation:
B = bucky; %original matrix
p = symrcm(B);
R = B(p,p); %matrix after SYMRCM
% obtaining the original matrix from the matrix after SYMRCM
s=1:length(B);
e(p)=s;%map to original matrix.
G=R(e,e);
subplot(1,2,1), spy(B), title('B');
subplot(1,2,2), spy(G), title('R(e,e)');

More Answers (0)

Categories

Find more on Sparse Matrices in Help Center and File Exchange

Products


Release

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!