Updating matlab implementation to updated protocol
Matlab documentation.