function meshmodel(event)

frame=event;

fem=getdata(frame);

meshsize=frame.get('meshsize').getValue;

% Initialize mesh
fem.mesh=meshinit(fem, ...
                  'hmax',str2num(meshsize));

if isfield(fem,'xmesh')
  fem=rmfield(fem,'xmesh');
end

storedata(frame,fem);

parent=frame.get('axis').getHandle;
cla(parent);
meshplot(fem,'parent',parent);
