function B = prtv(A,i,j) % PRTV Retrieve elements of matrices in long format. % B = PRTV(A,i,j) retrieves the polynomials corresponding to % the (i,j) elements of an m-by-n matrix of polynomials stored % in an (m*n + 2)-by-(k+1) matrix (long format). % k is the highest degree of the polynomials in A. If length(i) % is M, LENGTH(j) is N, then B will be an (M*N + 2)-by-(k+1) % matrix of polynomials in long format. % B = PRTV(A,V) retrieves the polynomials corresponding to the % elements in V. The resulting matrix of polynomials is the % same size as V. % % To specify all the elements along one dimension use ':'. % For instance, PRTV(A,2:3,':') retrieves all the elements % in the second and third rows of A. % % See also ETCHG, ELCHG % Written by Serge Tchikanda 06/13/96. % Last revised by Serge Tchikanda 06/17/96. [m,n] = psize(A); [m1,n1]=size(A); D = A(2,1); if isempty(m) | isempty(n) return end if nargin == 2 if isempty(i) return end if strcmp(':',i) i = [1:m*n]'; end [mi,ni]=size(i); [B,d] = gpet(A,i); [mb,nb]=size(B); B = [[mi;d] zeros(2,nb-1);B]; else if isempty(i) | isempty(j); return end if strcmp(':',i) i = 1:m; end if strcmp(':',j) j = 1:n; end [B,d] = gpel(A,i,j); li = length(i); [mb,nb]=size(B); B = [[li;d] zeros(2,nb-1);B]; end