How to locate all sl_customization files on the MATLAB path?

2 次查看(过去 30 天)
In MATLAB versions up to R2019b I was able to use
which -all sl_customization
to locate all sl_customization.m and sl_customization.p files on the MATAB search path. That doesn't work anymore in newer versions.
Is there a new way to get this information?
  5 个评论
Ralf
Ralf 2023-8-10
@Michael: That works.
However, most of my colleagues have the same issue in R2022b, but not all of them. In addition, when working in a Simulink project, the command lists all sl_customization files in the project hierarchy.
In R2019b, the command
which -all sl_customization
shows always all occurances of sl_customization files.
Ralf
Ralf 2023-8-11
It seems that all the sl_customization files from earlier MATLAB versions vanished in newer version. That's why the output of
which -all sl_customization
seems to be correct.
That's why I'll close this question.

请先登录,再进行评论。

采纳的回答

Angelo Yeo
Angelo Yeo 2023-8-11
编辑:Angelo Yeo 2023-8-11
1) The official doc for which indates that "which -all" displays the paths to all items on the MATLAB path with the requested name, as well as any files in special folders that have been implicitly added to the path.
2) In R2022b, files with name including "sl_customization" (m or p files) can be found with Windows Explorer in MATLAB root folder as shown below. And none of the pathstr are members of MATLAB path as you can find with the script below.
str2test_R2022b = [
"C:\Program Files\MATLAB\R2022b\examples\slrequirements\main\sl_customization.m"
"C:\Program Files\MATLAB\R2022b\toolbox\rtw\rtwdemos\crl_demo\sl_customization.m"
"C:\Program Files\MATLAB\R2022b\toolbox\qualkits\iec\ecoder\tests\sl_customization.m"
"C:\Program Files\MATLAB\R2022b\toolbox\rtw\rtwdemos\pil_demo\sl_customization.m"
"C:\Program Files\MATLAB\R2022b\toolbox\coder\advisor\examples\sl_customization.m"
"C:\Program Files\MATLAB\R2022b\resources\Sldv\en\ModelAdvisor\sl_customization.xml"
"C:\Program Files\MATLAB\R2022b\toolbox\rtw\rtwdemos\examplePilF28335\sl_customization.m"
"C:\Program Files\MATLAB\R2022b\examples\ecoder\main\sl_customization.m"
"C:\Program Files\MATLAB\R2022b\examples\slcheck\main\sl_customization.m"
"C:\Program Files\MATLAB\R2022b\examples\systemcomposer\main\sl_customization.m"];
is_in_path = false(1, length(str2test_R2022b));
for i = 1:length(str2test_R2022b)
[pathstr, name, ext] = fileparts(str2test_R2022b(i));
is_in_path(i) = contains(lower(path), lower(pathstr{1}));
end
is_in_path =
1×10 logical array
0 0 0 0 0 0 0 0 0 0
3) On the other hand in R2019b, files with name including "sl_customization" (m or p files) can be found with Windows Explorer in MATLAB root folder as shown below. And 23 of them are included in the MATLAB path. This is what is shown in "which -all".
str2test_R2019b = [
"C:\Program Files\MATLAB\R2019b\toolbox\autoblks\autoblksutilities\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\aeroblks\aeroblksutilities\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\plccoder\plccoder\ladderlogic\plclib\studio5000\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\shared\aeroblks\aeroblksutilities\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\slcoverage\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\simulink\simulink\modeladvisor\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\simulink\sta\sl_sta_editor_block\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\simulink\simulink\SortingCheck\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\shared\codeinstrum\codeinstrum\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\fixedpoint\embeddedlib\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\robotics\robotsimulink\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\nav\navsimulink\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\shared\robotics\robotslcore\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\stateflow\stateflow\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\examples\slcheck\main\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\examples\slrequirements\main\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\slcheck\slcheckdemos\advisordemos\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\simrf\simrf\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\rtw\rtwdemos\crl_demo\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\qualkits\iec\ecoder\tests\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\rtw\rtwdemos\pil_demo\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\coder\advisor\examples\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\rtw\rtwdemos\examplePilF28335\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\physmod\elec\library\m\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\physmod\ne_sli\ne_sli\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\shared\nav_rst\nav_rst_simulink\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\robotics\robotsimulink\robotslgazebo\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\robotics\robotsimulink\robotslmanip\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\robotics\robotsimulink\robotslmobile\sl_customization.m"
"C:\Program Files\MATLAB\R2019b\toolbox\physmod\powersys\library\sl_customization.p"
"C:\Program Files\MATLAB\R2019b\toolbox\slcontrol\slctrlutil\sl_customization.p"];
is_in_path = false(1,length(str2test_R2019b));
for i = 1:length(str2test_R2019b)
[pathstr, name, ext] = fileparts(str2test_R2019b(i)); % Run this in R2019b
pathstr_saved{i} = pathstr{1};
is_in_path(i) = contains(lower(path), lower(pathstr{1}));
end
pathstr_saved(is_in_path)
whichpath = which('sl_customization','-all')

更多回答(1 个)

Ralf
Ralf 2023-8-11
It seems that all the sl_customization files from earlier MATLAB versions vanished in newer version. That's why the output of
which -all sl_customization
seems to be correct.
That's why I'll close this question.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by