toStruct
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 R2020a
See Also
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)