ok = pwSaveModelKeepingCustomStructure(m, filename, dataID, classes, commentOut, append)

 Saves a model to harddisk by overwriting an existing model definition
 file without removing the custom structure, e.g. custom comments.


Arguments for pwSaveModelKeepingCustomStructure

 m           A model struct. If unspecified the highest selected model.
 filename    Filename of an existing model which should be updated.
 dataID      ID of a data set to store data set dependent parameters values.
 classes     Cell array of classes or elements which will be updated
             in the given file corresponding to the values in m. If empty,
             all supported classes and elements will be updated:
 commentOut  Comments out objects which do not exist in model m.
             Default: true
 append      If true (=default), objects existing in the model struct which can
             not be located are appended.
             Set it to false if you work with IDs which are not literal
             strings like 'Erk1', but e.g. ['Erk', num2str(1)].
             These IDs can not be located automatically and the corresponding
             entry must be maintained manually.

 ok          True, if the model has been saved successfully. Else false.



 Please note that the complete line pwAdd... will be replaced.
 Therefore, custom comments within the same line will be lost.

 The old model file is backuped under
  [filename, '--backup--', datestr(now, 30), '.tmp']
 and can be compared to the current version using

See also