sw1 - I0=I0(R0); J0=J0(R0); m=min(m0,m1); I1=I1(1:m);...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function B=sw1(A) [M,N]=size(A); D=hgr(A); [I1,J1]=find( D>.5 ); m1=length(I1); R1=randperm(m1); I1=I1(R1); J1=J1(R1); [I0,J0]=find( D<-.5 ); m0=length(I0); R0=randperm(m0);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: I0=I0(R0); J0=J0(R0); m=min(m0,m1); I1=I1(1:m); J1=J1(1:m); I0=I0(1:m); J0=J0(1:m); w1=sparse(I1,J1,-1,M,N); w0=sparse(I0,J0,1,M,N); B=A+w0+w1;...
View Full Document

This note was uploaded on 04/19/2011 for the course MATH 21126 taught by Professor Johnson during the Spring '11 term at Carnegie Mellon.

Ask a homework question - tutors are online