MATLAB built-in examples not opening and giving error

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

"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."
How did you used openExample for earlier versions, when it was introduced in R2016a?
Did you use demo or echodemo instead?
@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.
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.
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.
Thank you both for your comments, and sorry about the typo.

Sign in to comment.

 Accepted Answer

According to the Release Notes for Simscape Electrical, the names of the example models and/or the way you access them changed in release R2023b. If you're referring to the online documentation (which is for the current release, release R2023b as I type this) you're seeing the newer names. Expanding the "Example name mapping" section in that Release Notes entry the name in release R2023a and before was ee_asm_scalar_control.
When I launch release R2023a and type that name a model opens. Or you could open the release R2023a documentation (in your installation or on the website), navigate to the example you want to open, copy the command to open it using the button in the upper-right corner of the example page, and run that in the MATLAB Command Window.

1 Comment

Thank you @Steven Lord. I used "ee_asm_scalar_control" and could open the example.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!