Contenuto principale

exportReport

Export report of Euro NCAP test scenario assessment results

Since R2026a

Description

Add-On Required: This feature requires the Automated Driving Toolbox Test Suite for Euro NCAP Protocols add-on.

exportReport(euroAssessmentObj,ncapTestName,fileName) exports the consolidated assessment results for the Euro NCAP® test scenario ncapTestName, defined by the protocol specifications object, euroAssessmentObj, to the file specified by fileName . The syntax only supports exporting to a PNG, JPEG or a PDF file.

example

exportReport(euroAssessmentObj,ncapGroupName,fileName) exports the consolidated assessment results for the Euro NCAP test group specified by ncapGroupName, to the file specified by fileName. The syntax only supports exporting to a PNG, JPEG or a PDF file.

example

Examples

collapse all

Specify a Euro NCAP test name.

ncapTestName = "SA AEB CCFtap";

Create a Euro NCAP protocol specification object.

euroAssessmentObj = euroAssessment;

Create an empty Euro NCAP assessment table for the specified Euro NCAP test name.

emptyAssessmentTable = assessmentTable(euroAssessmentObj,ncapTestName)
emptyAssessmentTable=9×2 table
     "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 8.3333m/s"    NaN
       "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 12.5m/s"    NaN
    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 16.6667m/s"    NaN
     "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 8.3333m/s"    NaN
       "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 12.5m/s"    NaN
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 16.6667m/s"    NaN
     "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 8.3333m/s"    NaN
       "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 12.5m/s"    NaN
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 16.6667m/s"    NaN

Create a copy of the empty assessment table, and fill in the values of the assessment criteria in the table.

filledAssessmentTable = emptyAssessmentTable;
filledAssessmentTable.CollisionAvoidance(:) = 1;

Compute the score for the specified Euro NCAP test name.

[score,assessmentTableUpdated] = ncapScore(euroAssessmentObj,ncapTestName,filledAssessmentTable);

Display the score for the specified Euro NCAP test name.

disp(score)
    AggregateScore: 1
    AvailableScore: 1

Display the updated assessment table.

disp(assessmentTableUpdated)
                        TestDescription                        CollisionAvoidance    EntryStatus    Points    Weights    Colors 
    _______________________________________________________    __________________    ___________    ______    _______    _______

    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 8.3333m/s"             1               "Valid"        1          1       "Green"
    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 12.5m/s"               1               "Valid"        1          1       "Green"
    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 16.6667m/s"            1               "Valid"        1          1       "Green"
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 8.3333m/s"             1               "Valid"        1          1       "Green"
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 12.5m/s"               1               "Valid"        1          1       "Green"
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 16.6667m/s"            1               "Valid"        1          1       "Green"
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 8.3333m/s"             1               "Valid"        1          1       "Green"
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 12.5m/s"               1               "Valid"        1          1       "Green"
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 16.6667m/s"            1               "Valid"        1          1       "Green"

Generate a report showing consolidated assessment results for the EURO NCAP test.

fig = ncapReport(euroAssessmentObj,ncapTestName);
fig.WindowState = "maximized";

Export report to a PNG image.

exportReport(euroAssessmentObj,ncapTestName,"results.png")

Specify a group of Euro NCAP test scenario names.

ncapTestGroup = {'SA AEB CCRs','SA AEB CCRm','SA AEB CCRb','SA AEB CCFtap', ...
    'SA AEB CCCscp','SA AEB CCFhos','SA AEB CCFhol','VRU AEB Crossing CPFA', ...
    'VRU AEB Crossing CPNA','VRU AEB Crossing CPNCO','VRU AEB Longitudinal CPLA', ...
    'VRU AEB Turning CPTAns','VRU AEB Turning CPTAno','VRU AEB Turning CPTAfs', ...
    'VRU AEB Turning CPTAfo','VRU AEB Reverse CPRs','VRU AEB Reverse CPRm', ...
    'VRU AEB Longitudinal CMRs','VRU AEB Longitudinal CMRb','VRU AEB Turning CMFtap', ...
    'VRU AEB Crossing CBFA','VRU AEB Crossing CBNA','VRU AEB Crossing CBNAO', ...
    'VRU AEB Longitudinal CBLA','VRU AEB Turning CBTAn','VRU AEB Turning CBTAf', ...
    'SA LSS LKA Solid Line','SA LSS LKA Dashed Line','SA LSS ELK Solid Line', ...
    'SA LSS ELK Road Edge','SA LSS ELK Oncoming vehicle', ...
    'SA LSS ELK Overtaking vehicle intentional', ...
    'SA LSS ELK Overtaking vehicle unintentional', ...
    'VRU LSS CM Oncoming vehicle','VRU LSS CM Overtaking vehicle unintentional', ...
    'VRU LSS CM Overtaking vehicle intentional'};

Load assessment criteria values for all the specified scenarios. assessmentCriteriaEntries is a cell array of the same size as ncapTestName. Each cell in assessmentCriteriaEntries contains the assessment criteria values for its corresponding Euro NCAP test scenario in ncapTestName.

Note: To use your own assessment data, you can run a test bench for each Euro NCAP test scenario to obtain its assessment criteria values.

load assessmentCriteriaEntries

Create a Euro NCAP protocol specification object.

euroAssessmentObj = euroAssessment;

Create assesment tables for all test scenarios in the test group using the assessmentTable function.

ncapTestGroupAssessmentTables = cellfun(@(x) assessmentTable(euroAssessmentObj,x),ncapTestGroup,UniformOutput=false);

As per Euro NCAP test specifications, the score of each scenario depends on its assessment criteria. For each test scenario:

  1. Get the assessment criteria from its corresponding assessment table.

  2. Update the assessment criteria values using the previously loaded assessmentCriteriaEntries cell array.

  3. Compute score for the test scenario using the ncapScore function.

for i = 1:numel(ncapTestGroup)
    assessmentCriteria = ncapTestGroupAssessmentTables{i}.Properties.VariableNames(2:end);
    ncapTestGroupAssessmentTables{i}(:,assessmentCriteria) = struct2table(assessmentCriteriaEntries{i});
    ncapScore(euroAssessmentObj,ncapTestGroup{i},ncapTestGroupAssessmentTables{i});
end

Compute the aggregate Euro NCAP score for the vulnerable road user (VRU) group name.

ncapGroupName = "VRU";
[scoreVRU,groupScoreVRU,allScoreVRU] = ncapScore(euroAssessmentObj,ncapGroupName)
scoreVRU = struct with fields:
    AggregateScore: 10.8021
    AvailableScore: 27

groupScoreVRU=2×3 table
    "AEB"    8.5354    23
    "LSS"    2.2667     4

allScoreVRU = struct with fields:
    AEB: [1×1 struct]
    LSS: [1×1 struct]

Compute the aggregate Euro NCAP score for the safety assist (SA) group name.

ncapGroupName = "SA";
[scoreSA,groupScoreSA,allScoreSA] = ncapScore(euroAssessmentObj,ncapGroupName)
scoreSA = struct with fields:
    AggregateScore: 4.5984
    AvailableScore: 11

groupScoreSA=2×3 table
    "AEB"    3.6567    8.5000
    "LSS"    0.9417    2.5000

allScoreSA = struct with fields:
    AEB: [1×1 struct]
    LSS: [1×1 struct]

Generate a report showing consolidated assessment results for the EURO NCAP test group.

fig = ncapReport(euroAssessmentObj,ncapGroupName);

Export the generated report to PNG image file.

exportReport(euroAssessmentObj,ncapGroupName,"results.png")

Input Arguments

collapse all

Euro NCAP assessment protocol specifications, specified as a euroAssessment object.

Euro NCAP test scenario name, specified as a character vector or string scalar. This value must match one of the ncapTestName values listed in the Euro NCAP Test Scenario Information tables.

Euro NCAP test group name, specified as a character vector or string scalar.

You can specify one of these test group names:

  • "EuroNCAP"

  • "StandardCarUrban"

  • "VRU"

  • "VRU LSS"

  • "VRU AEB"

  • "SA"

  • "SA LSS"

You can also specify one of these test end group names. Each end group represents multiple Euro NCAP test scenarios. For more information on end groups, see Euro NCAP End Group Names .

  • "VRU LSS Car-Motorcyclist"

  • "VRU AEB Car-Motorcyclist"

  • "VRU AEB Car-Bicyclist"

  • "VRU AEB Turning CBTA"

  • "VRU AEB Car-Pedestrian"

  • "VRU AEB Turning CPTA"

  • "SA AEB"

  • "SA LSS LKA"

  • "SA LSS ELK"

This figure shows the grouping hierarchy of Euro NCAP test scenarios in the Automated Driving Toolbox™ Test Suite for Euro NCAP® Protocols support package.

Name of file to export the assessment results with extension, specified as a string scalar. The exportReport function supports these file formats:

  • PNG

  • JPEG

  • PDF

More About

collapse all

Version History

Introduced in R2026a