function out = ismonic(A,D) %ISMONIC True for monic polymonials. % For row vectors, ISMONIC(A) returns 1 if A is a vector % whose elements are the coefficients of a monic polymonial % and 0 otherwise. % % ISMONIC(A,D) uses D as the common denominator of A. In % this case, the polynomial is monic if the coefficient % of its leading term equal D. (Default value is D = 1). % % If A is a matrix, then the rows of A are the coefficients % of the polynomials. % % See also ISMONICL % Written by Serge Tchikanda 03/28/96. [m,n]=size(A); ind = min(find(A(m,:))); if nargin == 1 if A(m,ind) ~= 1 out(m) = 0; else out(m) = 1; end else if A(m,ind) ~= D out(m) = 0; else out(m) = 1; end end if m ~= 1 if nargin == 1 out = [ismonic(A(1:m-1,:));out(m)]; else out = [ismonic(A(1:m-1,:),D);out(m)]; end end