Hi Hamza,
I understand you're encountering an issue while trying to install MATLAB R2023b on WSL with Windows 11. The error you're seeing often relates to graphics or missing libraries.
One possible solution to solve the error can be to preload the Freetype library. The problem can often be fixed by preloading the Freetype library before launching MATLAB. This approach ensures that MATLAB uses the system's version of the library, which may resolve compatibility issues. You can preload the Library by using the LD_PRELOAD environment variable to preload the Freetype library. Run MATLAB with the following command in your bash shell:
env LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libfreetype.so.6 matlab
This command forces MATLAB to use the system version of the Freetype library instead of its own.
Some additional tips if the issue persists will be to check your graphic setup by ensuring that an X server on Windows is present. Also make sure that your system libraries are up to date. You can also check the following fix for more information:
Hope this helps!
