Main Content

toStruct

ConvertobjectTrackobject to结构体

Description

example

S= toStruct(objTrack)converts an array ofobjectTrackobjects,objTrack, to an array of structures whose fields are equivalent to the properties ofobjTrack.

Examples

collapse all

Create a report of a track usingobjectTrack.

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 TrackLogic: 'History' TrackLogicState: 1 IsConfirmed: 1 IsCoasted: 0 IsSelfReported: 1 ObjectAttributes: [1x1 struct]

Convert the track object to a structure.

S = toStruct(track)
S =结构体with fields:TrackID: 1 BranchID: 0 SourceIndex: 1 UpdateTime: 0 Age: 1 State: [6x1 double] StateCovariance: [6x6 double] StateParameters: [1x1 struct] ObjectClassID: 0 TrackLogic: 'History' TrackLogicState: 1 IsConfirmed: 1 IsCoasted: 0 IsSelfReported: 1 ObjectAttributes: [1x1 struct]

Input Arguments

collapse all

Reports of object tracks, specified as an array ofobjectTrackobjects.

Output Arguments

collapse all

结构转换的objectTrack, returned as an array of structures. The dimension of the returned structure is same with the dimension of theobjTrackinput. The fields of each structure are equivalent to the properties ofobjectTrack.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2019b

See Also