- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To use the DisplayPerf utility the following 2 things should be added to your code (as well as including DisplayPerf.m in your project) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Add the following to your main shell: %global variables declarations global gPerfCnt gPerf gDebug %global variables initialization gDebug = 1; %enable debugging/performance DisplayPerf('init', tol, b); %b=row vector, tol=scalar %add this line before making each call to your function % implementing the numerical algorithm (e.g. GaussSeidel) DisplayPerf('reset'); ... %call to your function implementing the numerical algorithm x = GaussSeidel(A, x0, b, tol); ... %add this line after making each call to your function % implementing the numerical algorithm if gDebug DisplayPerf('Gauss-Seidel', A, b, x); %A=matrix, b=row vector, x=col vector end - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Add the following inside the loop of each of your function implementation: %for debugging and performance global gPerfCnt gPerf gDebug while (err > tol) ... if gDebug gPerfCnt = gPerfCnt + 1; gPerf.err(gPerfCnt) = err %error between successive approximations gPerf.Xn(gPerfCnt,:) = x'; %row vector of your next approximation end end %while