cell2cellarray

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

creates a cell list that contains all elements of a cell within one cell array



See Also: SGofSG , SGconcat

Example Illustration

 missing image of cell2cellarray(A)

Syntax

X=cell2cellarray(A)

Input Parameter

A: Hieraarchical cells

Output Parameter

X: [1 x n] cell array

Examples


S=SGbearing
cell2cellarray({S,S,{S;S}})




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 algorithm is designed to flatten a hierarchical cell array into a single-level cell array. It is part of the SolidGeometry library and was introduced in version 5.0.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize an empty cell array X.
  2. Check if A is not a cell array using ~iscell(A):
  3. If A is a cell array, iterate over each element of A using a for loop:
  4. Return the flattened cell array X.

Example

Given a cell array S=SGbearing, calling cell2cellarray({S,S,{S;S}}) will return a single-level cell array containing all elements of the nested structure.

Algorithm explaination created using ChatGPT on 2025-08-18 22: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