Command-Based Access to SPS Examples
Finding the right example model in SPS Software is now faster than ever! SPS provides a lightweight API to make exploring and opening example models seamless directly from the MATLAB® Command Window.
This command-based approach makes examples:
- Easy to discover: Browseable by category with tab completion.
- Fast to open: One command, no menus required.
- Consistent: The same commands work across all example families.
Here is a quick guide on how to navigate the SPS example library like a pro.
1. Browsing Examples by Category
SPS examples are exposed through the sps.Examples namespace. To see what is available, start typing and use the TAB key for auto-completion.
Type this in the Command Window and press TAB:
sps.Examples.
MATLAB will list all available categories, such as Analysis, Intro, Machines, PowerConverters, and Renewables.
You can keep digging. To see all analysis-related examples, type:
sps.Examples.Analysis.
And press TAB again.
2. Opening an Example Model
Once you find the example you want, use the open command.
% Format: open(sps.Examples.<Category>.<ExampleName>)
open(sps.Examples.Analysis.IEEE13NodeTestFeederExample)
This command instantly opens the associated Simulink model.
3. Accessing the Documentation
Most examples include a dedicated documentation page explaining the theory and usage.
To open the documentation for a specific example, use the doc command:
doc(sps.Examples.Analysis.LoadFlow5BusNetworkExample)
Lost the Example Name? Use the Model Name!
If you know the .slx file name (e.g., from an error message) but don’t know the exact category or example name, you can open its documentation directly:
sps.Catalog.openDocByModel("power_AveragedPulses.slx")
Want to see the entire library? Open the main SPS Example Models documentation page in your browser with:
sps.Examples.docHome
4. Listing and Searching
Don’t want to use tab completion? You can list and search the entire catalog.
List all examples in a specific category:
sps.Catalog.list("Analysis")
This returns a clean table showing the Example Name, Model File, and Title.
Search by keyword:
Looking for something specific, like average models? The search command checks categories, example names, and titles for your keyword.
sps.Catalog.search("average")
Speed up your workflow and explore the powerful benchmark models SPS has to offer!