by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 4.7, Creation date: 2019-08-04, Last change: 2025-09-14
See Also: smbDeleteUnconnectedLines
smlDeleteall([asys,typ])
asys: | default is gcs | |
typ: | default is {'line','block} |
new_system('SGLib_Arduino_Example','FromFile','Example_Arduino.slx'); open_system('SGLib_Arduino_Example');
smlDeleteall(gcs,'line')
This function, smlDeleteall, is designed to delete all lines and blocks from a specified block diagram in MATLAB. It is part of the SolidGeometry library and was introduced in version 4.7.
gcs (get current system).{'line','block'}.getfuncparams. If no parameters are provided, it defaults to the current system and both 'line' and 'block' types.typ parameter is a cell array. If it is, the function iterates over each element in the array, recursively calling smlDeleteall for each type specified.typ is not a cell array, the function uses find_system to locate all elements of the specified type within the system asys. The 'FindAll','on' options ensure that all matching elements are found.delete command.The example provided in the code demonstrates how to use the function:
new_system('SGLib_Arduino_Example','FromFile','Example_Arduino.slx');
open_system('SGLib_Arduino_Example');
smlDeleteall(gcs,'line')
This example creates a new system from a file, opens it, and then deletes all lines from the current system.
Algorithm explaination created using ChatGPT on 2025-08-18 23:08. (Please note: No guarantee for the correctness of this explanation)