Generate Euro NCAP Variants
Create Euro NCAP seed scenarios, generate variants, translate between simulators, plot descriptors, and compute scores using the ADT Euro NCAP support package APIs.
When to Use
- Creating Euro NCAP seed scenarios (any protocol year)
- Generating scenario variants from seeds
- Translating scenarios between drivingScenario and RoadRunner via descriptors
- Plotting scenario descriptors (single or multi-descriptor grids)
- Computing NCAP scores and generating/exporting reports
- Any workflow mentioning Euro NCAP test names (CCRs, CCFtap, CCCscp, CPNA, etc.)
When NOT to Use
- Building custom drivingScenario from scratch (roads, lanes, actors) — use drivingScenario core APIs directly
- RoadRunner scene/project management (creating projects, importing assets) — use RoadRunner scene APIs
- Custom
variationProperties for non-NCAP scenarios
- Simulink co-simulation or AEB test bench setup
Decision Tree: Which API Path?
User wants Euro NCAP scenarios?
│
├─ Protocol year 2023 (or unspecified)?
│ └─ Use standalone: ncapScenario("SA AEB CCFtap")
│ - Test names use prefix: "SA AEB", "SA LSS", "VRU AEB", "VRU LSS"
│ - Supports ShowProgress name-value
│ - Returns ScenarioDescriptor
│
└─ Protocol year 2026?
└─ Use euroAssessment path:
1. ea = euroAssessment(2026)
2. configureVUT(ea, ...) — if custom VUT needed
3. descriptor = ncapScenario(ea, "CA FC CCFtap")
- Test names use prefix: "CA FC"
- Does NOT support ShowProgress
- Required for scoring/reporting workflow
Key Functions
| Function |
Purpose |
Available From |
ncapScenario |
Generate seed descriptor(s) from test name |
R2024a |
euroAssessment |
Store 2026 protocol specs and scores |
R2025a |
configureVUT |
Set StabilizationTime, AssetPath on euroAssessment |
R2026a |
getScenario |
Convert descriptor → drivingScenario or RoadRunner |
R2022b |
getScenarioDescriptor |
Extract descriptor from existing drivingScenario |
R2022b |
generateVariants |
Generate variant descriptors from seed + variationProperties |
R2023a |
plot (ScenarioDescriptor) |
Plot descriptor(s), returns ScenarioDescriptorPlot |
R2026a |
configure (ScenarioDescriptorPlot) |
Set GridSize, Title, SubPlotTitles, CropType |
R2026a |
assessmentTable |
Create empty assessment table for a test |
R2025a |
ncapScore |
Compute score from assessment table (returns struct) |
R2025a |
ncapReport |
Generate visual report figure |
R2025a |
exportReport |
Export report to PDF/PNG/JPG file |
R2026a |
table2scenario |
Create ScenarioDescriptor from tabular data (sceneSpec, actorSpec, eventSpec) |
R2024a |
exportScenario (roadrunner) |
Export from RoadRunner to OpenSCENARIO |
R2022a |
Pattern: Seed-Only Generation
Use when you need just the seed scenario (1 descriptor), not all variants.
% 2023 standalone — single seed
descriptor = ncapScenario("SA AEB CCFtap");
% 2026 via euroAssessment — single seed
ea = euroAssessment(2026);
descriptor = ncapScenario(ea, "CA FC CCFtap");
AllScenarios=true generates the seed AND all protocol-defined variants. Do NOT use it when only the seed is requested.
Output arguments: The two-output form [descriptors, scenarioInfo] = ncapScenario(...) requires AllScenarios=true. Without it, only one output is allowed — requesting two outputs errors with "Too many output arguments".
Pattern: All Variants Generation
Use when the user wants all test variants for a given scenario.
% 2023 — all variants with progress
[descriptors, scenarioInfo] = ncapScenario("SA AEB CCCscp", AllScenarios=true);
% 2026 — all variants
ea = euroAssessment(2026);
[descriptors, scenarioInfo] = ncapScenario(ea, "CA FC CCCscp", AllScenarios=true);
Pattern: ShowProgress
The ShowProgress name-value controls built-in progress display during generation.
% Show command-line progress (default behavior)
descriptor = ncapScenario("SA AEB CCRs", ShowProgress="CommandLine");
% Suppress progress
descriptor = ncapScenario("SA AEB CCRs", ShowProgress="No");
Important: ShowProgress is only supported on the standalone ncapScenario(testName) call. It is NOT supported when using the euroAssessment overload ncapScenario(ea, testName).
When the user asks to "show progress" or "display progress", use ShowProgress="CommandLine" (or omit it since it's the default). Do NOT set ShowProgress="No" and then implement manual fprintf progress.
Pattern: DSD ↔ RoadRunner Translation
Use getScenario to translate a descriptor to either simulator. Never export to OpenSCENARIO and re-import as a translation method.
% Descriptor → drivingScenario
ds = getScenario(descriptor, Simulator="DrivingScenario");
% Descriptor → RoadRunner (requires active RoadRunner instance)
rrApp = roadrunner("C:/path/to/project");
rrScen = getScenario(descriptor, Simulator="RoadRunner", SimulatorInstance=rrApp);
Key rules:
getScenario requires Name-Value syntax. Simulator must be specified as a Name-Value pair, not a positional argument.
- With
Simulator="DrivingScenario": accepts an array of descriptors and returns an array of drivingScenario objects.
- With
Simulator="RoadRunner": accepts only a single descriptor per call — returns one Simulink.ScenarioSimulation object. Passing an array errors with "Too many input arguments". Loop over descriptors individually for batch RoadRunner translation.
Pattern: ScenarioDescriptorPlot
Configure options
| Property |
Values |
Notes |
GridSize |
[rows cols], max product = 20 |
Error if > 20 subplots |
Title |
string |
Figure title |
SubPlotTitles |
string array |
Must match descriptor count exactly |
CropType |
"None", "GlobalWaypoint", "DynamicWaypoint", "RuntimeActorsCrop" |
Controls plot cropping |
Single or small array (≤20 descriptors)
sdp = plot(descriptors);
configure(sdp, Title="My Scenarios", GridSize=[3 4], ...
SubPlotTitles=["Variant 1", "Variant 2", "Variant 3"]);
Large array (>20 descriptors)
ScenarioDescriptorPlot supports a maximum of 20 subplots per figure via GridSize. For larger arrays, split across multiple calls:
% Plot first 20
sdp1 = plot(descriptors(1:20));
configure(sdp1, Title="Variants 1-20", GridSize=[4 5]);
% Plot remaining
sdp2 = plot(descriptors(21:end));
configure(sdp2, Title="Variants 21-30", GridSize=[2 5]);
Play/seek for animation
sdp = plot(descriptor);
play(sdp); % Animate the scenario
seek(sdp, 2.5); % Jump to t=2.5s
close(sdp); % Close figure
Pattern: 2026 Full Pipeline (Score + Report)
% 1. Create assessment object
ea = euroAssessment(2026);
% 2. Configure VUT (optional)
configureVUT(ea, StabilizationTime=2, AssetPath="Vehicles/SK_SUV.fbx");
% 3. Generate all variants
[descriptors, scenarioInfo] = ncapScenario(ea, "CA FC CCFtap", AllScenarios=true);
% 4. Create assessment table and populate results
% Column names are test-dependent — inspect with at.Properties.VariableNames
% Common columns: ImpactVelocity (CCFtap, CCCscp) or RelativeImpactVelocity (CCRs, CCRm, CCRb)
at = assessmentTable(ea, "CA FC CCFtap");
at.ImpactVelocity = zeros(height(at), 1); % Replace with actual sim results
% 5. Compute score (returns struct, not scalar)
[score, updatedTable] = ncapScore(ea, "CA FC CCFtap", at);
fprintf("Total score: %.2f / %.2f\n", score.AggregateScore.Total, score.AvailableScore.Total);
% 6. Generate report figure
fig = ncapReport(ea, "CA FC CCFtap");
% 7. Export report to file
exportReport(ea, "CA FC CCFtap", "ncap_report.pdf");
Pattern: table2scenario (Custom Descriptors from Tables)
Use table2scenario to create a ScenarioDescriptor from user-defined tabular data. This is the programmatic entry point when you have scenario parameters in table form rather than using the predefined NCAP test definitions.
% Scene: straight road, 100m
sceneSpec = table(1, {'Straight'}, 100, 0, NaN, ...
VariableNames=["RoadElementID", "RoadElementType", "Length_Radius", ...
"DeltaHeading", "ParentIntersectionID"]);
% Actor: one car (Ego) on road 1, lane 1
actorSpec = table(1, 1, 1, {'Car'}, {'Ego'}, ...
{'4.7, 1.8, 1.4, 0.5, 0.9, 2.8'}, {'Along'}, {'10%, 50%'}, ...
VariableNames=["ActorID", "RoadID", "LaneID", "ActorType", ...
"ActorName", "Dimension", "Heading", "RelativePosition"]);
% Event: fixed velocity start at 15 m/s
eventSpec = table(1, 1, {'FixedVelocityStart'}, 15, NaN, NaN, ...
VariableNames=["EventID", "ActorID", "EventType", "Speed", ...
"Distance", "EventTrigger"]);
descriptor = table2scenario(sceneSpec, actorSpec, eventSpec);
Key rules:
sceneSpec columns: RoadElementID, RoadElementType, Length_Radius, DeltaHeading, ParentIntersectionID
actorSpec columns: ActorID, RoadID, LaneID, ActorType, ActorName, Dimension, Heading, RelativePosition
eventSpec columns: EventID, ActorID, EventType, Speed, Distance, EventTrigger
- Returns a
ScenarioDescriptor — same type as ncapScenario output
- The returned descriptor works with all downstream APIs:
getScenario, plot, generateVariants
- Used internally by the NCAP pipeline; users can call it directly for custom (non-NCAP) scenarios
Pattern: OpenSCENARIO Export with Rear Axle
% Configure export options
opts = openScenarioXMLExportOptions(RelocateVehicleOrigin=true);
% Export from RoadRunner
exportScenario(rrApp, "output.xosc", "OpenSCENARIO XML", opts);
See references/export-options.md for full export configuration details.
Test Name Conventions
Critical: Euro NCAP test names must be specified in full. Short names like "CCFtap" or "CCCscp" are NOT valid.
| Protocol |
Prefix Pattern |
Example |
| 2023 standalone |
"SA AEB ...", "SA LSS ...", "VRU AEB ...", "VRU LSS ..." |
"SA AEB CCFtap" |
| 2026 euroAssessment |
"CA FC ..." |
"CA FC CCFtap" |
The short code (e.g., CCFtap, CCCscp, CCRs) is always the LAST part of the full name.
See references/ncap-test-names.md for the complete lookup table of all valid test names.
Common Mistakes
| Mistake |
Why It's Wrong |
Correct Approach |
ncapScenario("CCFtap") |
Short names are not valid |
ncapScenario("SA AEB CCFtap") |
ncapScenario("SA AEB CCFtap") for 2026 |
Wrong prefix for 2026 protocol |
ncapScenario(ea, "CA FC CCFtap") with ea = euroAssessment(2026) |
getScenario(d, "RoadRunner") |
Positional arg not supported |
getScenario(d, Simulator="RoadRunner", SimulatorInstance=rrApp) |
Setting ShowProgress="No" then using fprintf |
Defeats built-in progress |
Omit ShowProgress (default is "CommandLine") or set ShowProgress="CommandLine" |
Using AllScenarios=true for seed-only |
Generates all variants unnecessarily |
Omit AllScenarios for seed only |
| DSD export → OpenSCENARIO → importScenario for RR |
Roundabout, breaks pedestrians |
getScenario(d, Simulator="RoadRunner", SimulatorInstance=rrApp) |
Inventing VUTType or NcapYear params |
These don't exist |
Use configureVUT(ea, AssetPath=...) and euroAssessment(2026) |
ShowProgress with euroAssessment overload |
Not supported on that overload |
Only use with standalone ncapScenario(testName) |
[d, info] = ncapScenario(ea, name) without AllScenarios |
"Too many output arguments" error |
Use single output for seed, or add AllScenarios=true for two outputs |
configureVUT called AFTER ncapScenario |
Silently has no effect — config not applied |
Always call configureVUT BEFORE ncapScenario |
SubPlotTitles count ≠ descriptor count |
"Invalid size of subplot titles" error |
Provide exactly one title per descriptor |
CropType="tight" or other invented values |
Invalid value error |
Use: "None", "GlobalWaypoint", "DynamicWaypoint", or "RuntimeActorsCrop" |
plot(descriptors) with GridSize > [4 5] |
Max 20 subplots per figure |
Split array into chunks of ≤20 |
fprintf("%.2f", score) after ncapScore |
score is a struct, not scalar |
Access score.AggregateScore.Total for the numeric value |
exportReport(ea, name, "report.html") |
HTML not supported |
Use .pdf, .png, or .jpg extension |
at.ImpactVelocity = ... for CCRs/CCRm/CCRb tests |
Column is RelativeImpactVelocity, not ImpactVelocity |
Check at.Properties.VariableNames after assessmentTable — use the actual column name |
getScenario(descriptors, Simulator="RoadRunner", ...) with array |
RoadRunner only accepts one descriptor at a time |
Loop: for i=1:numel(descriptors), getScenario(descriptors(i), ...); end |
Conventions
- Always use full test names — never abbreviate
- Use
euroAssessment(2026) for any 2026-protocol workflow (scoring, reporting, configureVUT)
- Use standalone
ncapScenario(testName) for simple 2023 generation without scoring
- Use
getScenario for ALL simulator translations — never export+reimport
- Use
exportReport (R2026a) for file export — do not write custom report export code
- Use
exportScenario (roadrunner method) for OpenSCENARIO export from RoadRunner
- Set
RelocateVehicleOrigin=true in export options when rear axle reference is needed
Required Toolboxes
- Automated Driving Toolbox (R2026a)
- Automated Driving Toolbox Test Suite for Euro NCAP Protocols (support package, R2024a+)
Copyright 2026 The MathWorks, Inc.
1---2name: matlab-use-ncap-protocol3description: Generate Euro NCAP test scenarios and variants using the ADT Euro NCAP support package. Use when creating NCAP seed scenarios, generating variants, translating between drivingScenario and RoadRunner, plotting scenario descriptors, computing NCAP scores, or exporting reports. Triggers on: ncapScenario, euroAssessment, getScenario, getScenarioDescriptor, generateVariants, ScenarioDescriptor, ScenarioDescriptorPlot, ncapScore, ncapReport, exportReport, configureVUT, assessmentTable, Euro NCAP, CCRs, CCRm, CCRb, CCFtap, CCCscp, CPNA, CPFA, CBNA, variant generation.4license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/lic5---67# Generate Euro NCAP Variants89Create Euro NCAP seed scenarios, generate variants, translate between simulators, plot descriptors, and compute scores using the ADT Euro NCAP support package APIs.1011## When to Use1213- Creating Euro NCAP seed scenarios (any protocol year)14- Generating scenario variants from seeds15- Translating scenarios between drivingScenario and RoadRunner via descriptors16- Plotting scenario descriptors (single or multi-descriptor grids)17- Computing NCAP scores and generating/exporting reports18- Any workflow mentioning Euro NCAP test names (CCRs, CCFtap, CCCscp, CPNA, etc.)1920## When NOT to Use2122- Building custom drivingScenario from scratch (roads, lanes, actors) — use drivingScenario core APIs directly23- RoadRunner scene/project management (creating projects, importing assets) — use RoadRunner scene APIs24- Custom `variationProperties` for non-NCAP scenarios25- Simulink co-simulation or AEB test bench setup2627## Decision Tree: Which API Path?2829```30User wants Euro NCAP scenarios?31│32├─ Protocol year 2023 (or unspecified)?33│ └─ Use standalone: ncapScenario("SA AEB CCFtap")34│ - Test names use prefix: "SA AEB", "SA LSS", "VRU AEB", "VRU LSS"35│ - Supports ShowProgress name-value36│ - Returns ScenarioDescriptor37│38└─ Protocol year 2026?39 └─ Use euroAssessment path:40 1. ea = euroAssessment(2026)41 2. configureVUT(ea, ...) — if custom VUT needed42 3. descriptor = ncapScenario(ea, "CA FC CCFtap")43 - Test names use prefix: "CA FC"44 - Does NOT support ShowProgress45 - Required for scoring/reporting workflow46```4748## Key Functions4950| Function | Purpose | Available From |51|----------|---------|----------------|52| `ncapScenario` | Generate seed descriptor(s) from test name | R2024a |53| `euroAssessment` | Store 2026 protocol specs and scores | R2025a |54| `configureVUT` | Set StabilizationTime, AssetPath on euroAssessment | R2026a |55| `getScenario` | Convert descriptor → drivingScenario or RoadRunner | R2022b |56| `getScenarioDescriptor` | Extract descriptor from existing drivingScenario | R2022b |57| `generateVariants` | Generate variant descriptors from seed + variationProperties | R2023a |58| `plot` (ScenarioDescriptor) | Plot descriptor(s), returns ScenarioDescriptorPlot | R2026a |59| `configure` (ScenarioDescriptorPlot) | Set GridSize, Title, SubPlotTitles, CropType | R2026a |60| `assessmentTable` | Create empty assessment table for a test | R2025a |61| `ncapScore` | Compute score from assessment table (returns struct) | R2025a |62| `ncapReport` | Generate visual report figure | R2025a |63| `exportReport` | Export report to PDF/PNG/JPG file | R2026a |64| `table2scenario` | Create ScenarioDescriptor from tabular data (sceneSpec, actorSpec, eventSpec) | R2024a |65| `exportScenario` (roadrunner) | Export from RoadRunner to OpenSCENARIO | R2022a |6667## Pattern: Seed-Only Generation6869Use when you need just the seed scenario (1 descriptor), not all variants.7071```matlab72% 2023 standalone — single seed73descriptor = ncapScenario("SA AEB CCFtap");7475% 2026 via euroAssessment — single seed76ea = euroAssessment(2026);77descriptor = ncapScenario(ea, "CA FC CCFtap");78```7980`AllScenarios=true` generates the seed AND all protocol-defined variants. Do NOT use it when only the seed is requested.8182**Output arguments:** The two-output form `[descriptors, scenarioInfo] = ncapScenario(...)` requires `AllScenarios=true`. Without it, only one output is allowed — requesting two outputs errors with "Too many output arguments".8384## Pattern: All Variants Generation8586Use when the user wants all test variants for a given scenario.8788```matlab89% 2023 — all variants with progress90[descriptors, scenarioInfo] = ncapScenario("SA AEB CCCscp", AllScenarios=true);9192% 2026 — all variants93ea = euroAssessment(2026);94[descriptors, scenarioInfo] = ncapScenario(ea, "CA FC CCCscp", AllScenarios=true);95```9697## Pattern: ShowProgress9899The `ShowProgress` name-value controls built-in progress display during generation.100101```matlab102% Show command-line progress (default behavior)103descriptor = ncapScenario("SA AEB CCRs", ShowProgress="CommandLine");104105% Suppress progress106descriptor = ncapScenario("SA AEB CCRs", ShowProgress="No");107```108109**Important:** `ShowProgress` is only supported on the standalone `ncapScenario(testName)` call. It is NOT supported when using the `euroAssessment` overload `ncapScenario(ea, testName)`.110111When the user asks to "show progress" or "display progress", use `ShowProgress="CommandLine"` (or omit it since it's the default). Do NOT set `ShowProgress="No"` and then implement manual fprintf progress.112113## Pattern: DSD ↔ RoadRunner Translation114115Use `getScenario` to translate a descriptor to either simulator. Never export to OpenSCENARIO and re-import as a translation method.116117```matlab118% Descriptor → drivingScenario119ds = getScenario(descriptor, Simulator="DrivingScenario");120121% Descriptor → RoadRunner (requires active RoadRunner instance)122rrApp = roadrunner("C:/path/to/project");123rrScen = getScenario(descriptor, Simulator="RoadRunner", SimulatorInstance=rrApp);124```125126**Key rules:**127- `getScenario` requires Name-Value syntax. `Simulator` must be specified as a Name-Value pair, not a positional argument.128- With `Simulator="DrivingScenario"`: accepts an array of descriptors and returns an array of `drivingScenario` objects.129- With `Simulator="RoadRunner"`: accepts only a **single descriptor** per call — returns one `Simulink.ScenarioSimulation` object. Passing an array errors with "Too many input arguments". Loop over descriptors individually for batch RoadRunner translation.130131## Pattern: ScenarioDescriptorPlot132133### Configure options134135| Property | Values | Notes |136|----------|--------|-------|137| `GridSize` | `[rows cols]`, max product = 20 | Error if > 20 subplots |138| `Title` | string | Figure title |139| `SubPlotTitles` | string array | Must match descriptor count exactly |140| `CropType` | `"None"`, `"GlobalWaypoint"`, `"DynamicWaypoint"`, `"RuntimeActorsCrop"` | Controls plot cropping |141142### Single or small array (≤20 descriptors)143144```matlab145sdp = plot(descriptors);146configure(sdp, Title="My Scenarios", GridSize=[3 4], ...147 SubPlotTitles=["Variant 1", "Variant 2", "Variant 3"]);148```149150### Large array (>20 descriptors)151152`ScenarioDescriptorPlot` supports a maximum of 20 subplots per figure via `GridSize`. For larger arrays, split across multiple calls:153154```matlab155% Plot first 20156sdp1 = plot(descriptors(1:20));157configure(sdp1, Title="Variants 1-20", GridSize=[4 5]);158159% Plot remaining160sdp2 = plot(descriptors(21:end));161configure(sdp2, Title="Variants 21-30", GridSize=[2 5]);162```163164### Play/seek for animation165166```matlab167sdp = plot(descriptor);168play(sdp); % Animate the scenario169seek(sdp, 2.5); % Jump to t=2.5s170close(sdp); % Close figure171```172173## Pattern: 2026 Full Pipeline (Score + Report)174175```matlab176% 1. Create assessment object177ea = euroAssessment(2026);178179% 2. Configure VUT (optional)180configureVUT(ea, StabilizationTime=2, AssetPath="Vehicles/SK_SUV.fbx");181182% 3. Generate all variants183[descriptors, scenarioInfo] = ncapScenario(ea, "CA FC CCFtap", AllScenarios=true);184185% 4. Create assessment table and populate results186% Column names are test-dependent — inspect with at.Properties.VariableNames187% Common columns: ImpactVelocity (CCFtap, CCCscp) or RelativeImpactVelocity (CCRs, CCRm, CCRb)188at = assessmentTable(ea, "CA FC CCFtap");189at.ImpactVelocity = zeros(height(at), 1); % Replace with actual sim results190191% 5. Compute score (returns struct, not scalar)192[score, updatedTable] = ncapScore(ea, "CA FC CCFtap", at);193fprintf("Total score: %.2f / %.2f\n", score.AggregateScore.Total, score.AvailableScore.Total);194195% 6. Generate report figure196fig = ncapReport(ea, "CA FC CCFtap");197198% 7. Export report to file199exportReport(ea, "CA FC CCFtap", "ncap_report.pdf");200```201202## Pattern: table2scenario (Custom Descriptors from Tables)203204Use `table2scenario` to create a `ScenarioDescriptor` from user-defined tabular data. This is the programmatic entry point when you have scenario parameters in table form rather than using the predefined NCAP test definitions.205206```matlab207% Scene: straight road, 100m208sceneSpec = table(1, {'Straight'}, 100, 0, NaN, ...209 VariableNames=["RoadElementID", "RoadElementType", "Length_Radius", ...210 "DeltaHeading", "ParentIntersectionID"]);211212% Actor: one car (Ego) on road 1, lane 1213actorSpec = table(1, 1, 1, {'Car'}, {'Ego'}, ...214 {'4.7, 1.8, 1.4, 0.5, 0.9, 2.8'}, {'Along'}, {'10%, 50%'}, ...215 VariableNames=["ActorID", "RoadID", "LaneID", "ActorType", ...216 "ActorName", "Dimension", "Heading", "RelativePosition"]);217218% Event: fixed velocity start at 15 m/s219eventSpec = table(1, 1, {'FixedVelocityStart'}, 15, NaN, NaN, ...220 VariableNames=["EventID", "ActorID", "EventType", "Speed", ...221 "Distance", "EventTrigger"]);222223descriptor = table2scenario(sceneSpec, actorSpec, eventSpec);224```225226**Key rules:**227- `sceneSpec` columns: `RoadElementID`, `RoadElementType`, `Length_Radius`, `DeltaHeading`, `ParentIntersectionID`228- `actorSpec` columns: `ActorID`, `RoadID`, `LaneID`, `ActorType`, `ActorName`, `Dimension`, `Heading`, `RelativePosition`229- `eventSpec` columns: `EventID`, `ActorID`, `EventType`, `Speed`, `Distance`, `EventTrigger`230- Returns a `ScenarioDescriptor` — same type as `ncapScenario` output231- The returned descriptor works with all downstream APIs: `getScenario`, `plot`, `generateVariants`232- Used internally by the NCAP pipeline; users can call it directly for custom (non-NCAP) scenarios233234## Pattern: OpenSCENARIO Export with Rear Axle235236```matlab237% Configure export options238opts = openScenarioXMLExportOptions(RelocateVehicleOrigin=true);239240% Export from RoadRunner241exportScenario(rrApp, "output.xosc", "OpenSCENARIO XML", opts);242```243244See `references/export-options.md` for full export configuration details.245246## Test Name Conventions247248**Critical:** Euro NCAP test names must be specified in full. Short names like `"CCFtap"` or `"CCCscp"` are NOT valid.249250| Protocol | Prefix Pattern | Example |251|----------|---------------|---------|252| 2023 standalone | `"SA AEB ..."`, `"SA LSS ..."`, `"VRU AEB ..."`, `"VRU LSS ..."` | `"SA AEB CCFtap"` |253| 2026 euroAssessment | `"CA FC ..."` | `"CA FC CCFtap"` |254255The short code (e.g., `CCFtap`, `CCCscp`, `CCRs`) is always the LAST part of the full name.256257See `references/ncap-test-names.md` for the complete lookup table of all valid test names.258259## Common Mistakes260261| Mistake | Why It's Wrong | Correct Approach |262|---------|---------------|-----------------|263| `ncapScenario("CCFtap")` | Short names are not valid | `ncapScenario("SA AEB CCFtap")` |264| `ncapScenario("SA AEB CCFtap")` for 2026 | Wrong prefix for 2026 protocol | `ncapScenario(ea, "CA FC CCFtap")` with `ea = euroAssessment(2026)` |265| `getScenario(d, "RoadRunner")` | Positional arg not supported | `getScenario(d, Simulator="RoadRunner", SimulatorInstance=rrApp)` |266| Setting `ShowProgress="No"` then using fprintf | Defeats built-in progress | Omit ShowProgress (default is "CommandLine") or set `ShowProgress="CommandLine"` |267| Using `AllScenarios=true` for seed-only | Generates all variants unnecessarily | Omit `AllScenarios` for seed only |268| DSD export → OpenSCENARIO → importScenario for RR | Roundabout, breaks pedestrians | `getScenario(d, Simulator="RoadRunner", SimulatorInstance=rrApp)` |269| Inventing `VUTType` or `NcapYear` params | These don't exist | Use `configureVUT(ea, AssetPath=...)` and `euroAssessment(2026)` |270| `ShowProgress` with euroAssessment overload | Not supported on that overload | Only use with standalone `ncapScenario(testName)` |271| `[d, info] = ncapScenario(ea, name)` without AllScenarios | "Too many output arguments" error | Use single output for seed, or add `AllScenarios=true` for two outputs |272| `configureVUT` called AFTER `ncapScenario` | Silently has no effect — config not applied | Always call `configureVUT` BEFORE `ncapScenario` |273| `SubPlotTitles` count ≠ descriptor count | "Invalid size of subplot titles" error | Provide exactly one title per descriptor |274| `CropType="tight"` or other invented values | Invalid value error | Use: `"None"`, `"GlobalWaypoint"`, `"DynamicWaypoint"`, or `"RuntimeActorsCrop"` |275| `plot(descriptors)` with GridSize > [4 5] | Max 20 subplots per figure | Split array into chunks of ≤20 |276| `fprintf("%.2f", score)` after `ncapScore` | `score` is a struct, not scalar | Access `score.AggregateScore.Total` for the numeric value |277| `exportReport(ea, name, "report.html")` | HTML not supported | Use `.pdf`, `.png`, or `.jpg` extension |278| `at.ImpactVelocity = ...` for CCRs/CCRm/CCRb tests | Column is `RelativeImpactVelocity`, not `ImpactVelocity` | Check `at.Properties.VariableNames` after `assessmentTable` — use the actual column name |279| `getScenario(descriptors, Simulator="RoadRunner", ...)` with array | RoadRunner only accepts one descriptor at a time | Loop: `for i=1:numel(descriptors), getScenario(descriptors(i), ...); end` |280281## Conventions282283- Always use full test names — never abbreviate284- Use `euroAssessment(2026)` for any 2026-protocol workflow (scoring, reporting, configureVUT)285- Use standalone `ncapScenario(testName)` for simple 2023 generation without scoring286- Use `getScenario` for ALL simulator translations — never export+reimport287- Use `exportReport` (R2026a) for file export — do not write custom report export code288- Use `exportScenario` (roadrunner method) for OpenSCENARIO export from RoadRunner289- Set `RelocateVehicleOrigin=true` in export options when rear axle reference is needed290291## Required Toolboxes292293- Automated Driving Toolbox (R2026a)294- Automated Driving Toolbox Test Suite for Euro NCAP Protocols (support package, R2024a+)295296----297298Copyright 2026 The MathWorks, Inc.299300----