How to keep Simullink Library installed
2 views (last 30 days)
Show older comments
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!
0 Comments
Answers (1)
Bhanu Prakash
on 18 Jul 2024
Edited: Bhanu Prakash
on 18 Jul 2024
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!
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!