Note that this reference documentation is identical to the help that is displayed in MATLAB when you type “help keepfields”.

  KEEPFIELDS makes a selection of the fields in a structure
 
  Use as
    s = keepfields(s, fields);
 
  See also REMOVEFIELDS, COPYFIELDS