custom kpis



In addition to the predfined KPIs which are calculated by MXeval directly, custom KPIs can be appended to the evaluation process. Those KPIs must be defined in the lower table by adding them via the context menu. In the upper editor, MATLAB Code can be used to calculate custom KPIs (see Custom Code Limitations).

The test specific "template" gives more information about the required outputs (OUT_KPI) and available inputs (IN_DATA) of the script.


The number of calcualted KPIs must always match the number of rows in the definition table!


Script info

% Available data:

%       - IN_DATA:      [1x1 struct] Data from the evaluation process. This 

%                       struct contains all the data, which has been parsed 

%                       to the evaluation. The data fields are as follows.

%   - Time          s        [1xN double]   Time                      

%   - SWA           deg      [1xN double]   SW Angle                  

%   ... 

%   (this channel list depends on the current test)

%       - IN_TESTID:    [1xN char] Test ID of the current test

%

% Required data:

%       - OUT_KPI:      [Nx1 double] vector containing the calculated custom

%                       KPIs.

Example

This custom KPI example is included in the "Vehicle Dynamics - Weave Test" settings.


Example code:

OUT_KPI(1) = min(IN_DATA.SWA)

% minimun SW angle

OUT_KPI(2) = max(IN_DATA.SWA)

% maximum SW angle

OUT_KPI(3) = min(IN_DATA.SWT)

% minimun SW torque

OUT_KPI(4) = max(IN_DATA.SWT)

% maximum SW torque

OUT_KPI(5) = mean(IN_DATA.Vel)

% Mean vehicle velocity


Example definition: