% Copyright Trimble Inc
function data = load_viewdat(filename)
  [dir,name,ext] = fileparts(filename);
  if strcmp(ext, 'mat') == 0,
    load(filename);
    data=data';
    cnt=1;
    varname = sprintf('data%d',cnt);
    while exist(varname),
      eval(sprintf('data=[data;transpose(%s)];',varname));
      eval(sprintf('clear %s',varname));
      cnt=cnt+1;
      varname = sprintf('data%d',cnt);
    end
  else
    data = load(filename);
  end
