Skip to Main Content Skip to Search
Product Documentation

AddFilter - Add user-defined filter to data set

Syntax

D = AddFilter(D, expr)

Description

This is a method of mbcmodel.data.

A filter is a constraint on the data set used to exclude some records. You define the filter using logical operators or a logical function on the existing variables.

D is the mbcmodel.data object you want to filter.

expr is an input string holding the expression that defines the filter.

Examples

AddFilter(D, 'AFR < AFR_CALC + 10');

The effect of this filter is to keep all records where AFR < AFR_CALC +10.

AddFilter(D, 'MyFilterFunction(AFR, RPM, TQ, SPK)');

The effect of this filter is to apply the function MyFilterFunction using the variables AFR, RPM, TQ, SPK.

All filter functions receive an nx1 vector for each variable and must return an nx1 logical array out. In that array, true (or 1) indicates a record to keep, and false (or 0) indicates a record to discard.

See Also

AddTestFilter | Filters | ModifyFilter | ModifyTestFilter | RemoveFilter

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS