主要内容

gainparts

Get or set gain part value for sensor in insCF

Since R2026a

    Description

    part = gainparts(filter,sensorName) returns the value of the gain part for the specified sensor sensorName. Sensor gain is the weight the filter gives to data from that sensor during the correction phase of sensor fusion.

    example

    gainparts(filter,sensorName,value) sets the value of the gain part for the specified sensor to value.

    example

    Examples

    collapse all

    Create an insCF object with four sensors.

    filt = insCF(insCFAccelerometer,insCFMagnetometer,insCFGyroscope,insCFGPS);

    Get the default gain values of the sensors.

    gpsGain = gainparts(filt,"GPS")
    gpsGain = 
    0.0100
    
    magnetometerGain = gainparts(filt,"Magnetometer")
    magnetometerGain = 
    0.0100
    
    accelerometerGain = gainparts(filt,"Accelerometer")
    accelerometerGain = 
    0.0100
    

    Set the gain to new values.

    gainparts(filt,"Accelerometer",0.0001)
    gainparts(filt,"GPS",0.00025)
    gainparts(filt,"Magnetometer",0.0001)

    Verify the new gain values.

    gpsGain = gainparts(filt,"GPS")
    gpsGain = 
    2.5000e-04
    
    magnetometerGain = gainparts(filt,"Magnetometer")
    magnetometerGain = 
    1.0000e-04
    
    accelerometerGain = gainparts(filt,"Accelerometer")
    accelerometerGain = 
    1.0000e-04
    

    Input Arguments

    collapse all

    Complementary filter, specified as an insCF object.

    Sensor name, specified as "Accelerometer", "GPS", "Gyroscope", or "Magnetometer". The specified sensor name must correspond to one of the sensors present in the specified filter.

    Value for the gain part, specified as a numeric scalar in the range [0, 1]. This argument sets the value of the gain part for the specified sensor sensorName (Navigation Toolbox).

    Example: gainparts(insCF,"Accelerometer",0.0001)

    Data Types: double

    Output Arguments

    collapse all

    Gain part value for the sensor, returned as a numeric scalar.

    Extended Capabilities

    expand all

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

    Version History

    Introduced in R2026a

    See Also

    Objects

    Functions