Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (10 sloc) 175 Bytes
function [L,C,S]=spr2lcs(A)
% [L,C,S]=SPR2LCS(A)
%
% The reverse of LCS2SPR
[m,n]=size(A);
[L,C,S]=find(A);
[L,j]=sort(L);
S=S(j);
C=C(j);
L=full(cumsum(sparse(L,1,1,m,1)));