Syntax
s=gcsb([bl])
Input Parameter
bl : | | block; default is gcb |
Output Parameter
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, gcsb
, is designed to return the name of a block within the current system in Simulink. It is part of the SimMechanics library and was created by Tim Lueth on December 26, 2016. The function primarily interacts with Simulink's current system and block functions.
Input Parameters
- bl: This is the block whose name is to be returned. If not provided, the default is the current block, which is obtained using
gcb
.
Output
- s: This is the name of the block within the current system, with the system path removed.
Algorithm Steps
- Initialize the variable
bl
with the current block using gcb
.
- Check if there is at least one input argument and if it is not empty. If so, set
bl
to the first input argument.
- Use
strrep
to remove the current system path from bl
. This is done by replacing the current system path, obtained using gcs
, with an empty string.
- Replace any newline characters in the block name with a space using
strrep
.
- Return the processed block name as
s
.
Algorithm explaination created using ChatGPT on 2025-08-18 22:33. (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