% reshape a matrix into parameter list or vice verca
%
% P = preshape(p), pads 8long vector with 1 and organizes into 3 by 3 matrix
%
% p = preshape(P), normalizes by P(3,3), then organizes as 8long vector

function t = dummy(T);

if (max(size(T))~=3)|(min(size(T))~=3)
  if (max(size(T))~=8)|(min(size(T))~=1)
    error('preshape.m: input must be a 3 by 3 matrix or 8 long vector')
  end%if
  T=[T(:); 1];
  t=reshape(T,3,3);
  t=t.';
else%if
  if T(3,3)~=0
    t=reshape(T.',1,9)/T(3,3);
    t=t(1:8);
  else%if
    error('preshape.m: lower right element of input zero (should be nonzero)')
  end%if
end%if

