Hi Himanshu,
To resolve an issue where MATLAB references an older version of the MATLAB Compiler Runtime (MCR) despite having MATLAB 2021a installed, it's essential to verify the installed MCR versions, ensure the correct path is set, and use the "mcrinstaller" from the appropriate MATLAB version.
- Verify Installed MCR Versions:
Check Installation Directories: Navigate to C:\Program Files\MATLAB\MATLAB Runtime on Windows
or the equivalent directory on macOS/Linux to see which MCR versions are installed.
Windows:
1] Access Environment Variables through Control Panel > System and Security > System >
Advanced system
2] Modify the PATH variable to point to the MATLAB 2021a directories instead of MATLAB 2020a.
macOS/Linux:
1] In the terminal, use echo $PATH to view the current path.
2] Edit your profile script (.bash_profile, .bashrc) to update the path to include the MATLAB 2021a .
directory.
- Use the mcrinstaller from the Correct Version:
1] Navigate to the MATLAB 2021a installation directory in your system's file explorer or terminal.
2] Run the “mcrinstaller” executable directly from this directory to ensure you're using the version
associated with MATLAB 2021a.
You can refer to the below documentation to get a better understanding of MATLAB mcr installations.
Hope it helps!
Thanks