smlNewSystem

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 4.7, Creation date: 2019-08-03, Last change: 2025-09-14

opens a new simulink sheet - overwrites an exiting one

Description

The Coder parameters are taken from a file named 'Example_Arduino.slx'.
If this file is missing, try loadweb ('Example_Arduino.slx',true);

See Also: smbNewSystem

Example Illustration

 missing image of smlNewSystem(SName,Coder)

Syntax

smlNewSystem([SName,Coder])

Input Parameter

SName: Name of the new system such as
Coder: Name of Sheet Example; default is 'arduino'

Examples


smlNewSystem('SGLib_Arduino_Example')




Copyright 2019-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, smlNewSystem, is designed to create a new Simulink system or overwrite an existing one. It is part of the SolidGeometry library and was introduced in version 4.7. The function takes two optional input parameters: SName and Coder.

Input Parameters

Algorithm Steps

  1. Retrieve the input parameters using the getfuncparams function. If not provided, default values are used.
  2. Display a message indicating that the system will be cleared and overwritten if it already exists.
  3. Attempt to save the current system state using save_system. If the system is open, close it using close_system without saving changes.
  4. Check if a file with the name SName.slx exists. If it does, delete the file.
  5. Use a switch statement to handle different Coder values:
  6. Call smlDeleteall to delete all elements in the new system.
  7. Open the new system using open_system with the 'force' option to ensure it opens even if it is already open.
  8. Save the new system using save_system.
Algorithm explaination created using ChatGPT on 2025-08-19 08:07. (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