Main Content

vrnode/getfield

(To be removed) Field value of vrnode object

vrnode/getfield will be removed in a future release. For more information, see Version History.

Syntax

getfield(vrnode_object)
x = getfield(vrnode_object)
x = getfield(vrnode_object,'fieldname')

Arguments

vrnode_object

Name of a vrnode object representing the node to be queried.

fieldname

Name of the vrnode object field whose values you want to query.

Description

getfield(vrnode_object) displays all the field names and their current values for the respective node.

x = getfield(vrnode_object), where vrnode_object is a scalar, returns a structure where each field name is the name of a vrnode field and each field contains the value of that field.

x = getfield(vrnode_object,'fieldname')returns the value of the specified field for the node referenced by the vrnode_object handle. If vrnode_object is a vector of vrnode handles, getfield returns an M-by-1 cell array of values, where M is equal to length(vrnode_object).

If 'fieldname' is a 1-by-N or N-by-1 cell array of strings containing field names, getfield returns an M-by-N cell array of values.

Tip

Using dot notation is the recommended approach for accessing nodes.

Note

For Transform nodes, the getfield function does not list the Simulink® 3D Animation™ extensions rotation_abs and translation_abs. To access those fields, use dot notation. For example:

gcoords = myWorld.Arm.rotation_abs

Version History

Introduced before R2006a

collapse all

R2023b: To be removed

The vrnode/getfield will be removed in a future release. Instead, use sim3d classes and Simulation 3D blocks to interface MATLAB® and Simulink with the Unreal Engine® 3D simulation environment. To get started, see Create 3D Simulations in Unreal Engine Environment.