MATLAB Answers

Error using exampleUti​ls.compone​ntExamples​Dir (line 13) Invalid argument "simulink_automotive".

조회 수: 14(최근 30일)
GOVIND SHAJAN
GOVIND SHAJAN 2021년 1월 10일
댓글: GOVIND SHAJAN 2021년 1월 12일
Hello!
I know that I am facing this issue due to me not installing the correct toolbox. I am trying to open the example given by the Matlab Command "openExample('simulink_automotive/ModelingAnAutomaticTransmissionControllerExample')". But I am unsure of which one that I need to install so that I can open the example of
Modeling an Automatic Transmission Controller.
Can you let me know which one is the toolbox that I need to install? I have both stateflow and simulink installed. This is the exact error message I am getting.
Error using exampleUtils.componentExamplesDir (line 13)
Invalid argument "simulink_automotive".
Error in findExample (line 18)
componentExamplesDir = exampleUtils.componentExamplesDir(component);
Error in openExample (line 30)
metadata = findExample(exampleId);

채택된 답변

Jemima Pulipati
Jemima Pulipati 2021년 1월 12일
Hello,
From my understanding, the above mentioned error occurs when a toolbox required to open a model is not installed.
The dependencies.toolboxDependencyAnalysis(files) gives a cell array of the toolbox names required by the files in the argument 'files'. These are the toolbox names for the model you mentioned.
files={'ModelingAnAutomaticTransmissionControllerExample'};
[names, folders] = dependencies.toolboxDependencyAnalysis(files)
names =
1×4 cell array
{'MATLAB'} {'Simulink'} {'Simulink Coder'} {'Stateflow'}
folders =
1×4 cell array
{'matlab'} {'simulink'} {'simulinkcoder'} {'stateflow'}
Since you mentioned you have 'Simulink' and 'Stateflow' installed, you may have to install 'Simulink Coder'.
Hope this helps!
  댓글 수: 1
GOVIND SHAJAN
GOVIND SHAJAN 2021년 1월 12일
Hi! I got the solution. I have Simulink Coder installed as well. The issue is that this example is made using MATLAB 2020b. I was able to open the example in MATLAB Online and export it to the 2020a version from there. Thank you for your response!

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by