MATLAB fails to start with errors indicating 'Unrecognized function or variable' despite multiple reinstallations and configuration checks on Ubuntu.
15 views (last 30 days)
Show older comments
I am experiencing persistent issues with MATLAB on Ubuntu 22.04 LTS. After multiple attempts to install and configure MATLAB R2024a, including re-downloading and reinstalling the software, MATLAB fails to start correctly with error messages indicating 'Unrecognized function or variable' and other related errors.
Details:
1. Error Messages:
- "Unrecognized function or variable 'matlabrc'."
- "Unrecognized function or variable 'initprefs'."
- "com.mathworks.jmi.MatlabException: Unrecognized function or variable 'initprefs'."
2. Steps Taken:
- Installed MATLAB from the official .zip file.
- Verified and set up environment variables.
- Ensured required packages (like libcanberra-gtk-module) are installed.
- Created symbolic links for MATLAB executable.
- Checked for and verified the presence of key MATLAB files (matlabrc.m and userpath.m).
3. Observations:
- The MATLAB executable works correctly when run from a terminal session where it was originally opened.
- After restarting the computer or opening MATLAB from a new terminal, it shows the same errors.
- The restoredefaultpath command is unrecognized, indicating potential issues with the MATLAB path or installation.
4. Commands and Outputs:
- Commands attempted include: matlabroot, getenv('MATLABPATH'), rehash, restoredefaultpath
- Output from ls -l commands show that necessary files (matlabrc.m, userpath.m) are present in /usr/local/MATLAB/R2024a/toolbox/local.
5. Current System Status:
- MATLAB shows errors on startup related to missing functions or variables.
- Symbolic links and environment variables appear to be correctly set, yet MATLAB does not function as expected after rebooting or in new terminal sessions.
I need assistance in diagnosing and resolving these startup errors to ensure MATLAB operates correctly and consistently after each reboot and in new terminal sessions. Any suggestions on further troubleshooting steps or configuration adjustments would be greatly appreciated.
1 Comment
Shubham
on 8 Sep 2024
I think you should create a service request for this: https://www.mathworks.com/support/contact_us.html?s_tid=hc_trail
Answers (1)
Vandit
on 8 Sep 2024
Hello Ágape,
Based on the information you've provided, it seems you've taken the correct steps for installing MATLAB R2024a on Ubuntu 22.04 LTS. Here are a few suggestions to troubleshoot the issue:
- See if your system meets the specifications for MATLAB in Linux (https://www.mathworks.com/support/requirements/matlab-linux.html).
- Try the debugging steps given in this MATLAB Central question, to regenerate preferences, check your working directory, etc. (https://www.mathworks.com/matlabcentral/answers/1437679-matlab-won-t-start-on-ubuntu-20-04).
- If you encounter an issue where "restoredefaultpath" is unrecognized, you might find it helpful to refer to this MATLAB Answers thread for a potential solution (https://www.mathworks.com/matlabcentral/answers/1904195-unable-to-run-the-restoredefaultpath-function).
If the issue persists, you can go ahead and create a Service Request for the same (https://www.mathworks.com/support/contact_us.html?s_tid=hc_trail).
Hope this helps.
0 Comments
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!