This is a Matlab bug on Linux + Intel graphics chips, often reported to Mathworks, never fixed by them. It doesn’t affect Psychtoolbox at all, just plotting in Matlab.
Diagnosis and ok solution see:
Update with a possibly better solution on recent Matlab:
What also worked for me on Ubuntu 20.04.6-LTS, Intel graphics, Mesa 21.2.6, with Matlab R2023b is the following older approach at fixing it: