MATLAB built-in examples not opening and giving error
Show older comments
I use version 2023a. Toolboxes are properly installed (Simsacpe and Simscape electrical). [SL: fixed typo in release number based on information from sidebar.]
When I try opening the example, I get the following error:
>> openExample('simscapeelectrical/InductionMachineScalarExample')
found =
logical
0
Error using matlab.internal.examples.findExamplesXml
Unable to find "simscapeelectrical/InductionMachineScalarExample". Check whether
"simscapeelectrical" is the location for "simscapeelectrical/InductionMachineScalarExample" and
try again.
Error in findExample (line 14)
examplesXml = matlab.internal.examples.findExamplesXml(component,arg);
Error in setupExample (line 6)
metadata = findExample(arg);
Error in openExample (line 30)
[workDir,metadata] = setupExample(exampleId, workDir);
This error is not specific to this example. I get the same error for any example that I need to open using the openExample(***) format.
I installed the documentation locally and also tried online version, and restarted MATLAB, but I still had the same error.
I appreciate any help. I did not have this issue in the past when I used earlier versions.
6 Comments
Dyuman Joshi
on 3 Nov 2023
"I use version 2013a."
"I get the same error for any example that I need to open using the openExample(***) format."
"I did not have this issue in the past when I used earlier versions."
Steven Lord
on 3 Nov 2023
@Dyuman Joshi For anyone confused by this comment, I edited the post after this comment was written to fix what I assumed was a typo (13 instead of 23) based on the fact that the Release information on the right side of this page said R2023a.
Dyuman Joshi
on 3 Nov 2023
Thanks for the update, Steven, even I was consufed after reading your answer, and seeing that R2013a was changed to R2023a.
Unfortunately, I have (automatically/subconciously) developed a (bad) habit of not paying attention to the Release information, as in almost all of the questions I engage with, it is not present. And also, the details were mentioned in the problem description here, so I didn't look there.
Steven Lord
on 3 Nov 2023
I admit I checked when I saw 13a to confirm when openExample was introduced because I was pretty sure it was newer than that. Then I looked at the Release information and assumed that the 1 in the problem statement was a typo. Then searching the documentation for the name of the example I found the Release Notes entry and made the further assumption that the user was referring to the newer documentation and trying to use what they saw there in their older release.
Dyuman Joshi
on 3 Nov 2023
Makes sense.
Pooya Taheri
on 3 Nov 2023
Accepted Answer
More Answers (0)
Categories
Find more on Variable Initialization 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!