필터 지우기
필터 지우기

How to keep Simullink Library installed

조회 수: 5 (최근 30일)
Simon
Simon 2024년 1월 3일
편집: Bhanu Prakash 2024년 7월 18일 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!

답변 (1개)

Bhanu Prakash
Bhanu Prakash 2024년 7월 18일 12:40
편집: Bhanu Prakash 2024년 7월 18일 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!

카테고리

Help CenterFile Exchange에서 Introduction 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