toStruct
Convert objectTrack
object to
struct
Syntax
Description
converts an array of S
= toStruct(objTrack
)objectTrack
objects,
objTrack
, to an array of structures whose fields are equivalent to
the properties of objTrack
.
Examples
Convert objectTrack
to Struct
Create a report of a track using objectTrack
.
x = (1:6)'; P = diag(1:6); track = objectTrack('State', x, 'StateCovariance', P)
track = objectTrack with properties: TrackID: 1 BranchID: 0 SourceIndex: 1 UpdateTime: 0 Age: 1 State: [6x1 double] StateCovariance: [6x6 double] StateParameters: [1x1 struct] ObjectClassID: 0 ObjectClassProbabilities: 1 TrackLogic: 'History' TrackLogicState: 1 IsConfirmed: 1 IsCoasted: 0 IsSelfReported: 1 ObjectAttributes: [1x1 struct]
Convert the track object to a structure.
S = toStruct(track)
S = struct with fields:
TrackID: 1
BranchID: 0
SourceIndex: 1
UpdateTime: 0
Age: 1
State: [6x1 double]
StateCovariance: [6x6 double]
StateParameters: [1x1 struct]
ObjectClassID: 0
ObjectClassProbabilities: 1
TrackLogic: 'History'
TrackLogicState: 1
IsConfirmed: 1
IsCoasted: 0
IsSelfReported: 1
ObjectAttributes: [1x1 struct]
Input Arguments
objTrack
— Reports of object track
array of objectTrack
object
Reports of object tracks, specified as an array of objectTrack
objects.
Output Arguments
S
— Structures converted from objectTrack
array of structure
Structures converted from objectTrack
, returned as an array of
structures. The dimension of the returned structure is same with the dimension of the
objTrack
input. The fields of each structure are equivalent to
the properties of objectTrack
.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2019b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)