**Description of the problem** See PR https://github.com/GenericMappingTools/pygmt/pull/556 and review https://github.com/GenericMappingTools/pygmt/pull/556#discussion_r466764835 for context. In short, Session.write_data() can write a netCDF grid for a matrix grid. We need to add a test to check it works.