On NixOS I got MATLAB running in an Ubuntu 22.04 Distrobox, though I had to install some libraries in the Distrobox.
— Jeffrey Fisher
terminate called after throwing an instance of 'std::runtime_error' what(): Unable to launch the MATLABWindow application Aborted