smbConvertSubsystem

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.0, Creation date: 2016-11-11, Last change: 2025-09-14

SimMechanics converts blocks to a subsystem

Description

This function is the core of smbCreateSubsystem.


See Also: smbCreateSubsystem

Example Illustration

 missing image of smbConvertSubsystem(SSName,blocks)

Syntax

smbConvertSubsystem(SSName,blocks)

Input Parameter

SSName: SubSystem Name
blocks: List of Blocks




Copyright 2016-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, smbConvertSubsystem, is designed to convert a list of Simulink blocks into a subsystem. It is part of the SimMechanics library and was created by Tim Lueth. Below is a detailed explanation of the algorithm and its parameters.

Input Parameters

Algorithm Steps

  1. Initialize an empty array bh to store block handles.
  2. Iterate over each block in the blocks list:
  3. Create a subsystem from the collected block handles using Simulink.BlockDiagram.createSubSystem.
  4. Set the name of the newly created subsystem to SSName using set_param.
  5. Adjust the position of the subsystem using smbSetPosition and smbNewGridPos.
  6. Assign the current block handle to h using gcb (get current block).
  7. If the MATLAB version is at least R2020, call smbfindPMIOPort to rename PMIO ports as needed.

Additional Notes

The function is part of a larger library and interacts with other functions such as smbCreateSubsystem and smbExpandSubsystem. It is designed to work with Simulink models and requires specific MATLAB versions for certain features.

Algorithm explaination created using ChatGPT on 2025-08-18 23:25. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21