% make a random l x m x n tensor

function t=trand(l,m,n)

if nargin == 1,
  t = tzeros(l);
elseif nargin == 3,
  t = tzeros(l,m,n);
else
  error('either one or three arguments required')
end

cols = size(t,2)-1;
t(:,1:cols) = rand(l(1),cols);
