function [] = syscheck(A,B) %SYSCHECK denotes whether or not matricies A and B will fit into the % equation A x X = B and give solutions for all x-values. [m1 n1] = size(A); [m2 n2] = size(B); if n2 ~= 1 error('Indeterminant: Matrix B is not a column matrix'); elseif m1 ~= m2 error('Indeterminant: Matricies A and B must have the same number of rows'); end [X, pivot] = rref([A,B]); if length(pivot) ~= m1 error('Indeterminant: Incorrect number of linearly independant rows'); else disp('System is OK'); end return;