Syntax
h=smbAddFrame(FName)
Input Parameter
FName : | | String with the Tranformation Name |
Output Parameter
Examples
smbAddFrame ('Frame 1')
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, smbAddFrame
, is designed to add a Rigid Transformation Block in a SimMechanics model. Below is a detailed explanation of the algorithm and its parameters.
Input Parameters
- FName: A string representing the name of the transformation. This is used to identify the block within the SimMechanics model.
Output Results
- h: A handle to the block that is created. This handle can be used for further manipulation or querying of the block within the model.
Algorithm Steps
- Retrieve the current Simulink system using
gcs
, which stands for "get current system". This is stored in the variable FSys
.
- Construct the full block name by concatenating the current system name with the provided transformation name
FName
. This is done using sprintf
and stored in BName
.
- Add a Rigid Transform block to the current system using the
add_block
function. The block is sourced from the SimMechanics library path 'sm_lib/Frames and Transforms/Rigid Transform'
and is added with the name BName
. The handle to this block is returned as h
.
- If no output argument is specified (i.e.,
nargout==0
), the function opens the current system using open(FSys)
.
- Retrieve and display the port connectivity of the current block using
get_param(gcb,'PortConnectivity')
. This provides information about the block's input and output ports.
The function is straightforward, focusing on adding a specific type of block to a SimMechanics model and optionally opening the model and displaying port connectivity information.
Algorithm explaination created using ChatGPT on 2025-08-18 22:06. (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