    % Construct an affine3d object that defines a different scale factor in
    % each dimension.
    clc;close all;clear all
    Sx = 1.2;
    Sy = 1.6;
    Sz = 2.4;
    tform = affine3d([Sx 0 0 0; 0 Sy 0 0; 0 0 Sz 0; 0 0 0 1]);
 
    % Apply forward geometric transformation to an input (U,V,W) point (1,1,1)
    [X,Y,Z] = transformPointsForward(tform,1,1,1)
 
    % Apply inverse geometric transformation to output (X,Y,Z) point from
    % previous step. We recover the point we started with from
    % the inverse transformation.
    [U,V,W] = transformPointsInverse(tform,X,Y,Z)