TLL2TL

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

Converts a long list of frames into an array of frames

Description

The long list format should be avoided!
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 , cell2matdim3 , cell2array

Example Illustration

 missing image of TLL2TL(TLL)

Syntax

TLA=TLL2TL(TLL)

Input Parameter

TLL: Long list format [n*4 x 4]

Output Parameter

TLA: array format [4 x 4 x n]

Examples


PL=PLsquare(40), TcopyVLez(PL(1:2,:)); TL=ans;
TLC=mat2celldim3(TL)

TLL=cell2mat(TLC) % AVOID !!!!!! BETTER USE cell2matdim3
TLA=TLL2TL(TLL) % ONLY NECESSARY IF cell2mat was used instead of cell2matdim3







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, TLL2TL, is designed to convert a long list of frames into an array of frames. It is part of the SG-Library and was developed by Tim Lueth. The function is necessary when a long list format is used, which should generally be avoided in favor of other formats.

Input Parameters

Output Results

Algorithm Explanation

The function checks if the number of rows in the input matrix TLL is greater than 4. If this condition is met, it indicates that the input is indeed in the long list format. The function then proceeds to convert this format into the array format.

The conversion is done using the following steps:

  1. The input matrix TLL is rotated 90 degrees using the rot90 function. This rearranges the data to facilitate reshaping.
  2. The reshaped matrix is then transformed into a 3D array with dimensions [4, 4, n] using the reshape function. This step effectively separates each 4x4 matrix into its own layer in the 3D array.
  3. Finally, the 3D array is rotated back to its original orientation using rot90 with a -1 argument, completing the conversion process.

This function is particularly useful when the long list format is inadvertently used, and a conversion to the more efficient array format is required. It is recommended to use the array format or cell format for handling transformation matrices in the SG-Library.

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