% % Written by: % -- % John L. Weatherwax 2006-12-19 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- randn('seed',0); rand('seed',0); n = 4; % create a matrix A: A = randn(n); % make A diagonally dominant: for ii=1:n, A(ii,ii) = 10; end % create a right hand side: f = randn(n,3); x = redBlackGSeidel(A,f); norm(A*x-f)