TLA=TLL2TL(TLL)
TLL : | Long list format [n*4 x 4] |
TLA : | array format [4 x 4 x n] |
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
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.
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:
rot90
function. This rearranges the data to facilitate reshaping.reshape
function. This step effectively separates each 4x4 matrix into its own layer in the 3D array.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)