# makehgtform

Create 4-by-4 transform matrix

## Syntax

## Description

### Identity Matrix

returns an identity
transform matrix. Applying an identify transform matrix to a
`M`

= makehgtform`Transform`

object resets its child objects to their original
orientation, position, and size.

### Scaling Matrix

returns a transform matrix that scales a `M`

= makehgtform("scale",`s`

)`Transform`

object.

If

`s`

is a scalar, the transform matrix scales uniformly by`s`

along the*x*-,*y*-, and*z*-axes.If

`s`

is a row vector`[sx sy sz]`

, the transform matrix scales along the*x*-axis by`sx`

, along the*y*-axis by`sy`

, and along the*z*-axis by`sz`

.

### Rotation Matrix

returns a transform matrix that rotates a `M`

= makehgtform("axisrotate",`[rx ry rz]`

,`r`

)`Transform`

object
counterclockwise around an axis `[rx ry rz]`

by
`r`

radians.

### Translation Matrix

returns a transform matrix that translates a `M`

= makehgtform("translate",`[tx ty tz]`

)`Transform`

object
along the *x*-axis by `tx`

units, along the
*y*-axis by `ty`

units, and along the
*z*-axis by `tz`

units. To avoid
translation along a particular axis, specify the corresponding translation
distance as 0. For example, `makehgtform("translate",[0 0 5])`

creates a transform matrix that translates only along the
*z*-axis by 5 units.

specifies the `M`

= makehgtform("translate",`tx`

,`ty`

,`tz`

)*x*, *y*, and
*z* translation distances as separate arguments.

**Note**

You can specify multiple transformations using two or more of the
input argument combinations in the listed syntaxes. For example,
`makehgtform("xrotate",pi,"scale",4)`

scales
uniformly by 4 and rotates around the *x*-axis by
`pi`

radians. You can specify any number and order
of transformations, and `makehgtform`

applies those
transformations in the reverse order. For more information about how the
order of specified transformations affects the resulting transform
matrix, see Apply Multiple Transformations.

## Examples

## Input Arguments

## Output Arguments

## More About

## Version History

**Introduced before R2006a**