Main Content

Automate Feature Extraction Using MATLAB Code from the App

Generate MATLAB® code in the app that reproduces the computations for your selected features, processed variables, and ranking

The Diagnostic Feature Designer app lets you work with ensemble data interactively and experiment with various processing and feature options. Once you have determined which features work best, you can generate code that reproduces your computations. This code allows you to apply the same computations to new or expanded ensemble data. You can use this code directly, or modify the code to suit your application. For more information on code generation in the app, see Automatic Feature Extraction Using Generated MATLAB Code.


Diagnostic Feature DesignerInteractively extract, visualize, and rank features from measured or simulated data for machine diagnostics and prognostics


expand all

workspaceEnsembleManage ensemble data stored in the MATLAB workspace using code generated by Diagnostic Feature Designer
findIndexFind the workspace ensemble member indices for members that match a specified variable name and value
readMemberReturn ensemble member data based on the member index
refreshUpdate a workspace ensemble with partitions of modified or added data computed in parallel processing
writeMemberWrite data to a specific workspace ensemble member
readallRead all data in datastore
readFeatureTableRead feature values, independent variables, and condition variables from an ensemble data set into a table
readMemberDataExtract data from an ensemble member given a path
resetReset datastore to initial state
uniqueUnique values in array
writeToLastMemberReadWrite data to member of an ensemble datastore
frameintervalsCreate frame intervals based on frame settings
joindataMerge two frame tables using an outer join
readFrameIntervalsExtract frame segments from an ensemble member
effectivefsEffective sampling rate of a time vector
time2numConvert duration or datetime array into numeric vector with the specified time unit
anova1One-way analysis of variance
bhattacharyyaDistanceOne-dimensional Bhattacharyya distance between two independent data groups to measure class separability
kruskalwallisKruskal-Wallis test
perfcurveReceiver operating characteristic (ROC) curve or other performance curve for classifier output
ranksumWilcoxon rank sum test
relativeEntropyOne-dimensional Kullback-Leibler divergence of two independent data groups to measure class separability
ttest2Two-sample t-test
correlationWeightedScoreAdjust feature ranking scores using correlation factor


Automatic Feature Extraction Using Generated MATLAB Code

Diagnostic Feature Designer can generate code that reproduces your interactive computations and allows you to automate feature extraction on similar input data. You select among your features, computed variables, and ranking tables to specify what the code includes.

Generate a MATLAB Function in Diagnostic Feature Designer

This example shows how to extract features from measurement data in the app and generate a MATLAB function that reproduces the calculations for those features.

Apply Generated MATLAB Function to Expanded Data Set

This example shows how use a reduced data set to develop features in Diagnostic Feature Designer, generate code to automate the feature computations you select, and then use that code with the full-member data set to compute a feature set for model training.

Anatomy of App-Generated MATLAB Code

Explore the functional organization of MATLAB code generated in Diagnostic Feature Designer.

Data Ensembles for Condition Monitoring and Predictive Maintenance

Algorithm design with Predictive Maintenance Toolbox™ uses data organized in ensembles. You can generate ensemble data from a Simulink® model or create ensembles from existing data stored on disk.