# nodeType

Get node type of node in factor graph

Since R2022a

## Syntax

``type = nodeType(graph,nodeID)``
``type = nodeType(factor,nodeID)``

## Description

example

````type = nodeType(graph,nodeID)` returns the type of the node with the specified node ID in the factor graph.```

example

````type = nodeType(factor,nodeID)` returns the type of the node with the specified node ID in the factor graph.```

## Examples

collapse all

Create factor graph, and generate node IDs one `factorPoseSE2AndPointXY` factor. Then create the `factorPoseSE2AndPointXY` factor and add the factor to the factor graph.

```fg = factorGraph; ids = generateNodeID(fg,1,"factorPoseSE2AndPointXY")```
```ids = 1×2 0 1 ```
```f = factorPoseSE2AndPointXY(ids); addFactor(fg,f);```

Get the types of node 0 and node 1.

`nodeType(fg,0)`
```ans = "POSE_SE2" ```
`nodeType(fg,1)`
```ans = "POINT_XY" ```

Generate node IDs to create one `factorPoseSE2AndPointXY` factor and then create the `factorPoseSE2AndPointXY` factor.

`f = factorPoseSE2AndPointXY([0 1]);`

Get the types of node 0 and node 1.

`nodeType(f,0)`
```ans = "POSE_SE2" ```
`nodeType(f,1)`
```ans = "POINT_XY" ```

## Input Arguments

collapse all

Factor graph, specified as a `factorGraph` object.

ID of node to check, specified as a nonnegative integer.

## Output Arguments

collapse all

Type of the node, returned as one of these node types:

• `"POSE_SE2"` — Pose in SE(2) state space

• `"POSE_SE3"` — Pose in SE(3) state space

• `"VEL3"` — 3-D velocity

• `"POINT_XY"` — 2-D point

• `"POINT_XYZ"` — 3-D point

• `"IMU_BIAS"` — IMU gyroscope and accelerometer bias

## Version History

Introduced in R2022a