It is quite a curious error, and even I faced the same one (Win10, Matlab 2018a). At one point using a ‘clear all’ command and rerunning the code worked, so I am sticking with that.
I agree you, I have met the same problem as you, when I use Matlab 2019a, Win 10 64bit a few days before. I think it worked indeed for using a ‘clear all’ command and rerunning the code.