Ubuntu 16.04 & Matlab 2019a: must force OpenGL hardware rendering

FYI: Fix for OpenGL rendering using Matlab 2019a, Ubuntu 16.04, Nvidia proprietary drivers


After installing Matlab 2019a on Ubuntu 16.04, Matlab was starting up with OpenGL Software rendering selected by default:

>> opengl info
                          Version: '2.1 Mesa 17.1.3'
                           Vendor: 'Brian Paul'
                         Renderer: 'Mesa X11'
                   MaxTextureSize: 16384
                           Visual: 'Visual 0x23, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antialias 0 samples)'
                         Software: 'true'
             HardwareSupportLevel: 'none (known graphics driver issues)'
        SupportsGraphicsSmoothing: 0
    SupportsDepthPeelTransparency: 1
       SupportsAlignVertexCenters: 0
                       Extensions: {157×1 cell}
               MaxFrameBufferSize: 16384

This is not good. Its also curious, because everything is/was running fine on the same machine in Matlab 2018a.
Had to manually select hardware rendering by executing opengl save hardware in the command window & restarting Matlab.
Things seem to be back to normal now:

>> opengl info
                          Version: '4.5.0 NVIDIA 384.130'
                           Vendor: 'NVIDIA Corporation'
                         Renderer: 'GeForce GTX 1080/PCIe/SSE2'
                   MaxTextureSize: 32768
                           Visual: 'Visual 0x27, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antialias 8 samples)'
                         Software: 'false'
             HardwareSupportLevel: 'full'
        SupportsGraphicsSmoothing: 1
    SupportsDepthPeelTransparency: 1
       SupportsAlignVertexCenters: 1
                       Extensions: {366×1 cell}
               MaxFrameBufferSize: 32768

Was that with or without matlab-support package installed?

the matlab-support package is installed, but I could not for the life of me figure out/remember how to rerun the matlab-support package to apply it to another Matlab install.

sudo apt-get install --reinstall matlab-support
automatically applies itself to the existing Matlab 2018a installation, without providing the option to select/define the matlab source directory

dpkg-reconfigure matlab-support