How to keep Simullink Library installed

2 ビュー (過去 30 日間)
Simon
Simon 2024 年 1 月 3 日
編集済み: Bhanu Prakash 2024 年 7 月 18 日
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!

回答 (1 件)

Bhanu Prakash
Bhanu Prakash 2024 年 7 月 18 日
編集済み: Bhanu Prakash 2024 年 7 月 18 日
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!

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by