function data=mphgetframe(node)
% data=mphgetframe(node)
%
% data=mphgetframe(model.frame('material1'))

data.coord = join(cell(node.coord), ', ');
data.identifier = char(node.identifier);
data.geom = char(node.geom);
data.isMaterialFrame = node.isMaterialFrame;
data.isMeshFrame = node.isMeshFrame;
data.isSpatialFrame = node.isSpatialFrame;
data.sorder = node.sorder;



% ---
function txt=join(c, sep, repnum)
% Join elements together using a separator
%
% txt=join(c, sep, repnum)
%
% Example:
% join({'a' 'b' 'c'}, ', ')
% join([1 4 7], ' - ')
%
% join('a', '\t', 3)
% join({'a' 'b' 'c'}, ', ', 2)
% join(4:8, ';', 4)

error(nargchk(1,3,nargin))

if nargin==1
    sep = ',';
end

if nargin==3
    if ischar(c)
        c = repmat({c}, repnum, 1);
    elseif iscell(c) | isnumeric(c)
        c = repmat(c(:), repnum, 1);
    end
end

if isnumeric(c)
    txt = num2str(c(1));
    for i=2:length(c)
        txt = [txt sep num2str(c(i))];
    end
else
    txt = c{1};
    for i=2:length(c)
        txt = [txt sep c{i}];
    end
end
% Copyright 2010-2011 COMSOL
