strarr2char

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Artificial Intelligence
Introduced first in SolidGeometry 5.4, Creation date: 2023-12-13, Last change: 2025-09-15

convertes a single row or single col string array into a char chain - no matrix

Description

RESULT IS LIKE: '"space on a" "a on table" "space on b" "b on table"'

See Also: char2strarr

Example Illustration

 missing image of strarr2char(strarr)

Syntax

chr=strarr2char(strarr)

Input Parameter

strarr: string array

Output Parameter

chr: char chain that containts a string array

Examples


x=[ "START" "move a from b to table" "move b from c to a" "move c from table to b" "FINISH"]
y=strarr2char(x)
u=char2strarr(y)




Copyright 2023-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, strarr2char, is designed to convert a single row or single column string array into a character chain. It is part of the SolidGeometry library and was introduced in version 5.4. The function is authored by Tim Lueth and is part of the VLFL-Lib, dated December 13, 2023.

Input Parameters

Output Results

Algorithm Steps

  1. The function begins by determining the separator to use. It calls getfuncparams with the first optional parameter from varargin, defaulting to a double quote (") if no separator is provided.
  2. A switch statement is used to handle different separator cases:

Example Usage

Consider the following example:

x = [ "START" "move a from b to table" "move b from c to a" "move c from table to b" "FINISH" ];
y = strarr2char(x);
u = char2strarr(y);

In this example, x is a string array. The function strarr2char converts it into a character chain y, and then char2strarr can be used to convert it back to a string array u.

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