meanT

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 5.1, Creation date: 2021-08-12, Last change: 2025-09-15

returns the man value of a T matrix



See Also: , meanGauss

Example Illustration

 missing image of meanT(TL)

Syntax

T=meanT(TL)

Input Parameter

TL: cell list or numerical sequence of 4x4 matrices

Output Parameter

T: mean value of a set of HT Matrices




Copyright 2021-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 calculates the mean value of a set of homogeneous transformation (HT) matrices. It is designed to handle both cell lists and numerical sequences of 4x4 matrices.

Input Parameters

Output Results

Algorithm Steps

  1. Convert Numerical Sequence to Cell List:

    If the input TL is a numeric array, it is converted into a cell list. This is done by dividing the array into 4x4 matrices using the mat2cell function. The function repmat(4, size(TL,1)/4, 1) is used to specify the size of each cell.

  2. Initialize Mean Matrix:

    The first matrix in the cell list TL is assigned to T as the initial mean matrix.

  3. Sum Matrices:

    A loop iterates over the matrices in TL starting from the second matrix. Each matrix is added to T.

  4. Calculate Mean:

    The sum of matrices stored in T is divided by the number of matrices to compute the mean.

  5. Normalize Rotation Vectors:

    The first three columns of the resulting mean matrix T are normalized to ensure they represent valid rotation vectors. This is done by dividing each column by its norm.

  6. Optional Visualization:

    If no output is requested (i.e., nargout==0), the function visualizes the transformation matrices. It reshapes the fourth column of each matrix into a set of vectors VL and uses functions sofBB, BBofVL, SGfigure, and tplot to plot the original and mean matrices.

Algorithm explaination created using ChatGPT on 2025-08-18 23:41. (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