array2tableTL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.9.1, Creation date: 2020-08-27, Last change: 2025-09-14

simple auxiliary fnct for debugging

Description

written in Grindelwald, CH

See Also: array2tableTL

Example Illustration

 missing image of array2tableTL(AR,VariableNames)

Syntax

ART=array2tableTL(AR,[VariableNames])

Input Parameter

AR: array
VariableNames: list of variabale names for cols; if 1st element is true => rownames

Output Parameter

ART: Table

Examples


array2tableTL(rand(2,2),'A','B')
array2tableTL(rand(3,2),true,'A','B','C')




Copyright 2020-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, array2tableTL, is designed to convert an array into a table format, with options for specifying row or column names. It is a utility function for debugging purposes.

Input Parameters

Output

Algorithm Steps

  1. Extract the variable names from the input arguments using varargin.
  2. Check if the first element of nam is a logical true:
    • If true, interpret the remaining elements as row names.
    • Check if the number of row names matches the number of rows in AR.
    • If they do not match, throw an error: 'array2tableTL: Wrong number of row names'.
    • Convert AR to a table using array2table with the specified row names.
  3. If the first element is not true:
    • Interpret the elements as column names.
    • Check if the number of column names matches the number of columns in AR.
    • If they do not match, throw an error: 'array2tableTL: Wrong number of column names'.
    • Convert AR to a table using array2table with the specified column names.

Example Usage

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