stringfnctresult

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Text/Strs/Chars/Links
Introduced first in SolidGeometry 4.8, Creation date: 2019-12-07, Last change: 2025-09-14

creates the cell list of output parameters of a batch call

Description

This function supports the collection of results within a batch job workspace
job=SGbatch('clear all; ZZZ=1+1'); wait(job); res=fetchOutputs(job); res{1}

See Also: , SGbatchjob , SGbatchresult , SGbatchdelete

Example Illustration

 missing image of stringfnctresult(str)

Syntax

[le,re]=stringfnctresult(str)

Input Parameter

str: function equation string

Output Parameter

le: list of narout
re: equation

Examples


stringfnctresult('sqrt(4)')
stringfnctresult('A=sqrt(4)')
stringfnctresult('[A,B,C]=sqrt(4)')




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, stringfnctresult, is designed to parse a function equation string and extract the left-hand side (LHS) and right-hand side (RHS) of the equation. It is part of the SolidGeometry library and is used to support batch job result collection.

Input Parameters

Output Results

Algorithm Steps

  1. Use strtok to split the input string str at the '=' character.
  2. If there is no '=' in the string, set le to 'ans' and re to the trimmed input string.
  3. If '=' is present:
    • Set le to the trimmed LHS of the equation.
    • Set re to the trimmed RHS of the equation, excluding the '=' character.
    • If le starts with '[', indicating multiple outputs:
      • Trim the brackets and split the string by ',' to get individual output variable names.
      • Trim each variable name and store them in le.

Example Usage

Algorithm explaination created using ChatGPT on 2025-08-19 07:04. (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