I realize this question is from a while ago, but I wanted to put in an answer to catch anyone else running into the same problem.
The MD5 checksum is used to ensure that both the origin and destination of the ROS message share the same message definition. If ROS tries to deserialize a message that is using a different message definition, the deserialization will be impossible. So if you are getting an MD5 checksum mismatch error, that means that the publisher (or client) is using a different message definition from the subscriber (or server).
Changing the MATLAB files that define the message object does not change the underlying message definition, nor will it have an impact on the back-end that does the serialization of the message. It will only ensure that "rosmsg md5 <type>" reports the incorrect value. Please do not change built-in MATLAB files, especially not without saving a back-up.
The correct way to handle this is to replace the standard messages that MATLAB uses to match the message definitions used by your external version of ROS. Before R2020b, MATLAB uses ROS Hydro/Indigo message definitions. Follow these instructions to update built-in message definitions using the custom message workflow.
R2020b has upgraded to ROS Melodic. In that release, to change to a different version of built-in message definitions you can simply call rosgenmsg on the folder with the desired definitions.