stringcellarray2charcell
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Artificial Intelligence
Introduced first in SolidGeometry 5.4, Creation date: 2023-12-11, Last change: 2025-08-19
converts xps cell list of string arrays into cell list of charchains
Description
RESULT IS LIKE: {'"space on a" "space on c" "a on b"' }
the current XPS format is a cell lits of string arrays that cannot be written in a n excel file without problems. Thid function converts the cell list of string arrays into a cell list of charchains
See Also: SGwritetable
, array2tableTL
, charcell2stringcellarray
Example Illustration
Syntax
zzz=stringcellarray2charcell(ops)
Input Parameter
Output Parameter
Examples
[ops,start, goal]=XPSblocksworld
stringcellarray2charcell(ops); xlscell=ans
SGwritetable('test.xls',array2tableTL(xlscell,'ACTION','CONDITION','ADD_LIST','DEL_LIST'))
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, stringcellarray2charcell, is designed to convert a cell list of string arrays into a cell list of character chains. This conversion is necessary because the current XPS format, which is a cell list of string arrays, cannot be easily written into an Excel file without issues.
Input Parameters
- ops: This is the primary input parameter, representing a cell list of string arrays that need to be converted.
- varargin: This is an optional parameter that allows the user to specify a custom separator. If not provided, the default separator is a double quote (
").
Output
- zzz: This is the output of the function, which is a cell list of character chains. Each element of the input cell list is converted into a single character chain.
Algorithm Steps
- The function begins by determining the separator to use. It calls the
getfuncparams function with the first element of varargin and a default value of " if varargin is empty.
- The input cell list
ops is assigned to the output variable zzz.
- A loop iterates over each element of
zzz (which is initially identical to ops).
- For each element, the function
strarr2char is called. This function converts the string array into a single character chain, using the determined separator.
- The converted character chain replaces the original string array in
zzz.
Example Usage
An example is provided in the comments:
[ops,start, goal]=XPSblocksworld
stringcellarray2charcell(ops,','); xlscell=ans
SGwritetable('test.xls',array2tableTL(xlscell,'ACTION','CONDITION','ADD_LIST','DEL_LIST'))
This example demonstrates how to convert a cell list of string arrays into character chains and then write the result to an Excel file using SGwritetable.
Algorithm explaination created using ChatGPT on 2025-08-19 07:28. (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