%% Trendability of Data in Cell Array of Tables
% In this example, consider the lifetime data of 10 identical machines with the following 6 potential prognostic parameters-constant, linear, quadratic, cubic, logarithmic, and periodic. The data set machineDataTable.mat contains T, which is a 1x10 cell array of tables where each element of the cell array contains a table of lifetime data for a machine.
% Load and display the data.

load('machineDataTable.mat','T');
display(T)
head(T{1},2)

% Note that every table in the cell array contains the lifetime variable 'Time' and the data variables 'Constant', 'Linear', 'Quadratic', 'Cubic', 'Logarithmic', and 'Periodic'.
%
% Compute trendability with Time as the lifetime variable.

Y = trendability(T,'Time')

% From the resultant table of trendability values, observe that the linear, cubic, and logarithmic features have values closer to 1. Hence, these three features are more appropriate for predicting remaining useful life since they are the best indicators of machine health.
% Copyright 2018 The MathWorks, Inc.
%
%