Main Content

setTunedProperties

Set properties to tuned values

Description

example

setTunedProperties(filter,tunedProps) sets the tunable properties to the tuned values in the tunedProps input argument.

Examples

collapse all

Load truth and detection data.

load("filterTuningData.mat","truth","detlog");

Create a default trackingFilterTuner object. Obtain the trackingEKF object using the FilterInitializationFcn property.

tuner = trackingFilterTuner(SolverOptions = optimoptions("fmincon",MaxIterations=20));
filter = feval(tuner.FilterInitializationFcn,detlog{1});

Tune the filter to obtain tuned properties.

tunedProps = tune(tuner,detlog,truth)
Solver stopped prematurely.

fmincon stopped because it exceeded the iteration limit,
options.MaxIterations = 2.000000e+01.
tunedProps = struct with fields:
       ProcessNoise: [3×3 double]
    StateCovariance: [6×6 double]

Set the tunable properties of the filter by using the setTuendProperty object function of the filter. Display the tuned process noise.

setTunedProperties(filter,tunedProps);
disp(filter.ProcessNoise);
    0.0001    0.0004    0.0002
    0.0004    0.0152    0.0022
    0.0002    0.0022    0.0009

Input Arguments

collapse all

Tracking filter, specified as one of these objects:

Tuned values, specified as a structure. In most cases, you can generate this structure from the tune object function of a trackingFilterTuner object.

This structure can have different fields for different tracking filter objects since the tunable properties of each tracking filter are different. For example, for the trackingEKF object, this structure has two fields: ProcessNoise and StateCovariance. Additionally, the value format of each field varies based on the setup of the tracking filter object. To see the tunable properties and corresponding value formats, use the tunableProperties object function of the filter.

Extended Capabilities

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

Version History

Introduced in R2022b