Clear Filters
Clear Filters

How can I change which pathdef.m is loaded each startup?

40 views (last 30 days)
Hello,
I have a newly installed MATLAB R2022b on Ubuntu 22.04 LTS. Unfortunately, two pathdef.m were saved in a directory that is readonly (toolbox/local and toolbox/local/template both in the MATLAB directory). When I try changing the permissions, I cannot because I "am not the owner, so [I] cannot change these permissions" of both the files.
I have created a new pathdef.m in my Documents/MATLAB directory. How can I get MATLAB to always use this pathdef.m file and NOT the ones that are saved in the programm directory?

Answers (1)

Steven Lord
Steven Lord on 29 Oct 2022
If you look inside the pathdef.m file you will see a comment that starts "DO NOT MODIFY THIS FILE."
Rather than creating your own pathdef.m, if you want to modify the saved path I recommend you use the Set Path icon in the Environment section of the Home tab of the toolstrip. If you want to modify it programmatically use path, genpath, addpath, rmpath, and savepath. If the path becomes corrupted or no longer allows you to call those functions, use restoredefaultpath.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!