getfield
Returns value of a field in a struct.
📝Syntax
value = getfield(st, field)
📥Input Arguments
Parameter Description
st a structure.
field a string.
📤Output Arguments
Parameter Description
value the value of a field from a structure.
📄Description

value = getfield(st, field) returns the value of the field named field from a structure.

💡Examples
example.a = 1
example.b = 'nelson'
example.c = []
getfield(example, 'b')
🔗See Also
structfieldnames
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub