Jump to content

Installing MATLAB: Difference between revisions

From RHLUG Wiki
Andrew (talk | contribs)
ui size
Andrew (talk | contribs)
code blocks
Line 2: Line 2:


=== Install with MATLAB package manager ===
=== Install with MATLAB package manager ===
Replace `/usr/local/MATLAB/` with watever you want, it may make more sense to have it in your home directory.
Replace `/usr/local/MATLAB/` with whatever you want, it may make more sense to have it in your home directory.


It needs to run with permission to edit files for authorization, if it is not owned by you run: `chmod -R 777 /usr/local/MATLAB/`
It needs to run with permission to edit files for authorization, if it is not owned by you run: <syntaxhighlight lang="sh">chmod -R 777 /usr/local/MATLAB/</syntaxhighlight>


==== Install your preferred release ====
==== Install your preferred release ====
you can make a new folder for each and have multiple or just use a single folder and overwrite your previous install
you can make a new folder for each and have multiple or just use a single folder and overwrite your previous install


`mpm install --release=R2025b --destination=/usr/local/MATLAB/R2025b MATLAB Simulink Control_System_Toolbox`
<syntaxhighlight lang="sh">mpm install --release=R2025b --destination=/usr/local/MATLAB/R2025b MATLAB Simulink Control_System_Toolbox</syntaxhighlight>


=== General install tips ===
=== General install tips ===
Line 16: Line 16:
If you are running a bleeding edge distro you will have to downgrade gnutls to 3.8.9, can be found here for arch: https://archive.archlinux.org/packages/g/gnutls/gnutls-3.8.9-1-x86_64.pkg.tar.zst
If you are running a bleeding edge distro you will have to downgrade gnutls to 3.8.9, can be found here for arch: https://archive.archlinux.org/packages/g/gnutls/gnutls-3.8.9-1-x86_64.pkg.tar.zst


Simply unzip all the *.so.[number] files into some sort of library directory specifically for MATLAB to preload it when launching MATLAB, something like `/usr/local/MATLAB/R2025b/lib` will do. Then in your .desktop file prepend `LD_LIBRARY_PATH=/usr/lib/dri/:/usr/local/MATLAB/R2025b/lib/`
Simply unzip all the *.so.[number] files into some sort of library directory specifically for MATLAB to preload it when launching MATLAB, something like `/usr/local/MATLAB/R2025b/lib` will do. Then in your .desktop file prepend <syntaxhighlight lang="sh">LD_LIBRARY_PATH=/usr/lib/dri/:/usr/local/MATLAB/R2025b/lib/</syntaxhighlight>


==== .desktop file tips ====
==== .desktop file tips ====
Copy the desktop file to your personal desktop file area to customize how it launches
Copy the desktop file to your personal desktop file area to customize how it launches


`sudo cp /usr/share/applications/matlab.desktop ~/.local/share/applications/matlab.desktop && sudo chown [user] [user] ~/.local/share/applications/matlab.desktop`
<syntaxhighlight lang="sh">sudo cp /usr/share/applications/matlab.desktop ~/.local/share/applications/matlab.desktop && sudo chown [user] [user] ~/.local/share/applications/matlab.desktop</syntaxhighlight>


change the exec line to keep existing preloads, directly call the the file, and have the startup folder preference be respected:
change the exec line to keep existing preloads, directly call the the file, and have the startup folder preference be respected:
 
<syntaxhighlight lang="sh">Exec=env 'LD_PRELOAD=/usr/lib/libfreetype.so:/usr/lib/libstdc++.so:/usr/lib/libfontconfig.so' LD_LIBRARY_PATH=/usr/lib/dri/ /usr/local/MATLAB/R2025b/bin/matlab -desktop -useStartupFolderPref</syntaxhighlight>
Exec=env 'LD_PRELOAD=/usr/lib/libfreetype.so:/usr/lib/libstdc++.so:/usr/lib/libfontconfig.so' LD_LIBRARY_PATH=/usr/lib/dri/ /usr/local/MATLAB/R2025b/bin/matlab -desktop -useStartupFolderPref`


== UI size ==
== UI size ==
In some 2025 release the ui zoom was disabled, you can set it in the MATLAB command window with:
In some 2025 release the ui zoom was disabled, you can set it in the MATLAB command window with:
 
<syntaxhighlight lang="matlab">settings().matlab.desktop.Zoom.PersonalValue=150</syntaxhighlight>
`settings().matlab.desktop.Zoom.PersonalValue=150`


if you want to tab through the possible settings you can change run:
if you want to tab through the possible settings you can change run:


```
<syntaxhighlight lang="matlab">
 
s=settings
s=settings
 
s.[ctrl+space/tab]</syntaxhighlight>
s.[ctrl+space/tab]
 
```

Revision as of 01:12, 14 October 2025

Install MATLAB:

Install with MATLAB package manager

Replace `/usr/local/MATLAB/` with whatever you want, it may make more sense to have it in your home directory.

It needs to run with permission to edit files for authorization, if it is not owned by you run:

chmod -R 777 /usr/local/MATLAB/

Install your preferred release

you can make a new folder for each and have multiple or just use a single folder and overwrite your previous install

mpm install --release=R2025b --destination=/usr/local/MATLAB/R2025b MATLAB Simulink Control_System_Toolbox

General install tips

gnutls breaking changes

If you are running a bleeding edge distro you will have to downgrade gnutls to 3.8.9, can be found here for arch: https://archive.archlinux.org/packages/g/gnutls/gnutls-3.8.9-1-x86_64.pkg.tar.zst

Simply unzip all the *.so.[number] files into some sort of library directory specifically for MATLAB to preload it when launching MATLAB, something like `/usr/local/MATLAB/R2025b/lib` will do. Then in your .desktop file prepend

LD_LIBRARY_PATH=/usr/lib/dri/:/usr/local/MATLAB/R2025b/lib/

.desktop file tips

Copy the desktop file to your personal desktop file area to customize how it launches

sudo cp /usr/share/applications/matlab.desktop ~/.local/share/applications/matlab.desktop && sudo chown [user] [user] ~/.local/share/applications/matlab.desktop

change the exec line to keep existing preloads, directly call the the file, and have the startup folder preference be respected:

Exec=env 'LD_PRELOAD=/usr/lib/libfreetype.so:/usr/lib/libstdc++.so:/usr/lib/libfontconfig.so' LD_LIBRARY_PATH=/usr/lib/dri/ /usr/local/MATLAB/R2025b/bin/matlab -desktop -useStartupFolderPref

UI size

In some 2025 release the ui zoom was disabled, you can set it in the MATLAB command window with:

settings().matlab.desktop.Zoom.PersonalValue=150

if you want to tab through the possible settings you can change run:

s=settings
s.[ctrl+space/tab]