主要内容

mbcmodel.data

Properties and methods for data objects

Description

Use these properties and object functions to create and examine data objects.

Creation

Create a mbcmodel.data object using CreateData.

Properties

expand all

Name of the data object.

Example: 'holliday_data.mat'

Data Types: char | string

This property is read-only.

Total number of records in data object.

Example: 270

Data Types: integer

This property is read-only.

Number of signals contained in each record.

Example: 7

Data Types: integer

This property is read-only.

Total number of tests used in model.

Example: 27

Data Types: double

This property is read-only.

Number of records in each test, where n is the number of tests.

Example: [10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10]

Data Types: double

This property is read-only.

Boolean indicating if data is editable. The following rules apply:

  • If the data was created using mbcmodel.CreateData and is not Attached to a test plan it is editable.

  • If the data was created or retrieved from the project and was not Attached to a test plan, it is editable.

  • If the data was Attached to a test plan and was subsequently retrieved from that test plan, it is editable.

Data Types: logical

This property is read-only.

Boolean indicating if data or model is being edited.

Example: 0

Data Types: logical

This property is read-only.

mbcmodel.project or mbcmodel.testplan object containing the data. The array is:

  • Empty if mbcmodel.CreateData created the data.

  • An mbcmodel.project object if a project contained the data.

  • An mbcmodel.testplan object if a test plan contained the data.

Data Types: function_handle

This property is read-only.

n-by-1 array of character vectors that contains the data signal names, where n is the number of signals.

Example: ["afr" "egr" "load" "n" "spark" "logno" "tq"]

Data Types: string

This property is read-only.

n-by-1 array of character vectors that contains the data signal units, where n is the number of signals.

Example: [ "%" "%" "ratio" "rpm" "deg" "none" "ft lbf"]

Data Types: string

This property is read-only.

Structure array holding user-defined filters. The array is the same length as the number of currently defined filters, with the following fields for each filter:

  • Expression — The character vector expression as defined in AddFilter or ModifyFilter.

  • AppliedOK — Boolean indicating that the filter was successfully applied.

  • RemovedRecords — Boolean vector indicating which records the filter removed. Note that many filters could remove the same record.

  • Message — Character vector holding information on the success or otherwise of the filter.

See also AddFilter, ModifyFilter, and RemoveFilter.

Data Types: struct

This property is read-only.

Structure array holding user-defined test filters. The array is the same length as the number of currently defined test filters, with the following fields for each filter:

  • Expression — The character vector expression as defined in AddTestFilter or ModifyTestFilter.

  • AppliedOK — Boolean indicating that the filter was successfully applied.

  • RemovedTests — Boolean vector indicating which records the filter removed. Note that many filters could remove the same test.

  • Message — Character vector holding information on the success or otherwise of the test filter.

See also AddTestFilter, ModifyTestFilter, and RemoveTestFilter.

Data Types: struct

This property is read-only.

Structure array holding user-defined variables. The array is the same length as the number of currently defined variables, with the following fields for each filter:

  • Variable — Variable Name

    • Expression — The character vector expression as defined in AddVariable or ModifyVariable.

    • Units — The character vector defining the units.

    • AppliedOK — Boolean indicating that the variable expression was successfully applied.

    • Message — Character vector holding information on the success or otherwise of the variable.

See also AddVariable, ModifyVariable, and RemoveVariable.

Data Types: struct

Object Functions

AddFilterAdd filter to data set
AddTestFilterAdd test filter to data set
AddVariableAdd variable to data set
AppendAppend data to data set
BeginEditBegin editing a data object
CreateDataCreate data object
CommitEditApply changes in data
DefineNumberOfRecordsPerTestDefine exact number of records per test
DefineTestGroupsDefine rule-based test groupings
ExportToTableExport data to table object
ExportToMBCDataStructureExport data to MBC data structure
ImportFromFileImport data from file
ImportFromMBCDataStructureLoad data from MBC data structure
ImportFromTableLoad data from a table object
ModifyFilterModify filter in data set
ModifyTestFilter Modify test filter in data set
ModifyVariable Modify variable in data set
RemoveFilterRemove filter from data set
RemoveTestFilterRemove test filter from data set
RemoveVariableRemove variable from data set
RollbackEditUndo most recent changes to data
ValueExtract data values from data object

Examples

collapse all

This example shows how to create a new data object that is independent of a project. filename is a character vector specifying the full path to the file. To use the data object in another test plan, use AttachData.

DataObj = mbcmodel.CreateData(filename);
testplan.AttachData(DataObj); 

This example shows how to create a data object in an existing project object ProjObj.

data = CreateData(ProjObj,'D:\MBCWork\data1.xls');
DataObj = mbcmodel.CreateData;
DataObj = mbcmodel.CreateData('D:\MBCWork\data.xls');

Version History

Introduced before R2006a