% This scipt was written to test penta solver for % MATH 501 computer assignment CSUF %by Nasser M. Abbasi. Feb 27,2007 clear all; format long; test=1; fprintf('==========>test %d\n',test); A=[15 -2 -6 0; -2 12 -4 -4; -6 -4 19 -9; 0 -1 -9 21] b=[300 0 0 0] fprintf('=======>our result\n'); x=nma_pentaSolve(A,b) fprintf('=======>Matlab result\n'); A\b' test=test+1; fprintf('==========>test %d\n',test); A=[15 8 -6 0 0 0; -2 12 -4 -4 0 0; -6 -4 19 -9 4 0; 0 -1 -9 21 6 7; 0 0 9 10 11 8; 0 0 0 10 -2 2] b=[300 0 0 0 1 2] fprintf('=======>our result\n'); x=nma_pentaSolve(A,b) fprintf('=======>Matlab result\n'); A\b' test=test+1; fprintf('==========>test %d\n',test); A=[15 8 -6 0 0 0 0; -2 12 -4 -4 0 0 0; -6 -4 19 -9 4 0 0; 0 -1 -9 21 6 7 0; 0 0 9 10 11 8 3; 0 0 0 10 -2 2 4; 0 0 0 0 -2 2 4] b=[300 0 0 0 1 2 6] fprintf('=======>our result\n'); x=nma_pentaSolve(A,b) fprintf('=======>Matlab result\n'); A\b' test=test+1; fprintf('==========>test %d\n',test); A=[15 8; 0 12] b=[300 0] fprintf('=======>our result\n'); x=nma_pentaSolve(A,b) fprintf('=======>Matlab result\n'); A\b' test=test+1; fprintf('==========>test %d\n',test); A=[15 8 -6 0 0 0 0 0; -2 12 -4 -4 0 0 0 0; -6 -4 19 -9 4 0 0 0; 0 -1 -9 21 6 7 0 0; 0 0 9 10 11 8 3 0; 0 0 0 10 -2 2 4 3; 0 0 0 0 -2 2 4 7; 0 0 0 0 0 4 8 9] b=[300 0 0 0 1 2 6 10] fprintf('=======>our result\n'); x=nma_pentaSolve(A,b) fprintf('=======>Matlab result\n'); A\b'