function [] = setdata(a,m)
% SETDATA - Sets the data representation in N-sphere.
% function [] = setdata(a,m)

% WRITTEN BY       : Kenth Engų, 1997.10.27
% LAST MODIFIED BY : Kenth Engų, 1999.04.07

global DMARGCHK

name = inputname(1);
if DMARGCHK
  if isempty(name),
    error('First argument to set must be a named variable');
  end;
  if ~isdata(a,m),
    error('Input data is not a data repr. for element in N-sphere!');
  end;
end;

len = length(a);
m = reshape(m,getshape(a(1).shape),len);
for i = 1:len,
  a(i).data = m(:,i);
end;
assignin('caller',name,a);  
return;
