cell2matdim3

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 5.2, Creation date: 2022-04-11, Last change: 2025-09-15

converts a cell list of frames into an array format

Description

In the SG-Lib frames are 4x4 homogenous transformation matrices. Nevertheless by development-over-time reasons, there are 3 different concepts for lists of frames
CELL FORMAT A cell list of [4x4] matrices {T1,T2,...}
ARRAY FORMAT An array of [4x4xn] matrices
LONG LIST FORMAT A long array list of [n*4 x 4] (SHOULD BE AVOIDED)


See Also: mat2celldim3 , cell2array , TLL2TL

Example Illustration

 missing image of cell2matdim3(TL)

Syntax

TLA=cell2matdim3(TL)

Input Parameter

TL: Cell list of frames

Output Parameter

TLA: Array format of Frames

Examples


PL=PLsquare(40), TcopyVLez(PL);TL=ans;
TLC=mat2celldim3(TL)
TLL=cell2mat(TLC)
TLA=cell2matdim3(TLC)
TLC=mat2celldim3(TLL)
TLA=cell2matdim3(TLC)




Copyright 2022-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, cell2matdim3, is designed to convert a cell list of frames into an array format. It is part of the SG-Library and was developed by Tim Lueth in 2022. The function is used to handle 4x4 homogeneous transformation matrices, which are common in robotics and computer graphics for representing transformations in 3D space.

Input Parameters

Output Results

Algorithm Steps

  1. Check if the input cell list TL is a row vector. If it is, transpose it to ensure it is a column vector. This is done using the condition if size(TL,1)==1; TL=TL'; end;.
  2. Convert the cell list TL into a long list format using cell2mat(TL). This concatenates all 4x4 matrices into a single long matrix TLL.
  3. Reshape the long list TLL into a 3D array format TLA using the following operations:
    • First, rotate TLL by 90 degrees using rot90(TLL).
    • Reshape the rotated matrix into a 3D array with dimensions 4x4xn using reshape(...,4,4,[]).
    • Finally, rotate the reshaped array back by -90 degrees using rot90(...,-1) to obtain the final array format TLA.

This function is useful for converting between different representations of transformation matrices, particularly when working with lists of transformations in 3D space.

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