Clear Filters
Clear Filters

How to keep Simullink Library installed

5 views (last 30 days)
Simon
Simon on 3 Jan 2024
Edited: Bhanu Prakash on 18 Jul 2024 at 12:45
My company uses a custom Library of components for simulation in Simulink. This Library is set up by running a Matlab script. After running the Matlab script this warning shows up:
Warning: Unable to save path to file 'C:\Program Files\MATLAB\R2023b\toolbox\local\pathdef.m'. You can save your path to a different
location by calling SAVEPATH with an input argument that specifies the full path. For MATLAB to use that path in future sessions,
save the path to 'pathdef.m' in your MATLAB startup folder.
Now the problem is that every time I want to access the Library in Simulink I need to run the Matlab script. Is there any way to make the library pernamently installed without the need to run the Matlab script every time I want to access it?
Thank you!

Answers (1)

Bhanu Prakash
Bhanu Prakash on 18 Jul 2024 at 12:40
Edited: Bhanu Prakash on 18 Jul 2024 at 12:45
Hi Simon,
The warning message you encountered might occur if the 'pathdef.m' file is read-only or located in a directory for which you don't have write access. To resolve this warning, you can try the workflow mentioned below:
1. Run the following command in MATLAB command window:
[status, cmdout] = system(['attrib -r "', fullfile(matlabroot, 'toolbox', 'local', 'pathdef.m'), '"'], 'runAsAdmin')
2. If the 'status' returns '0' ans 'cmdout' is an empty array, you can run your MATLAB script again to set-up the library.
3. If the 'status' is not '0', then you can try the steps mentioned in the warning to save 'pathdef.m' to a different folder where you have write access.
For more information on the above-mentioned workflow, you can refer to the following bug report:
For more troubleshooting steps, you can refer to the workarounds mentioend in the following MATLAB answer:
I hope this helps!

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!