Matlab Use Ncap Protocol logo

Matlab Use Ncap Protocol

OrganizationPopular
matlab
matlab-use-ncap-protocol

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.

Overview

Publishermatlab
Repositorymatlab-agentic-toolkit
Skill namematlab-use-ncap-protocol
Stars
1.2K
Forks
138
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by matlab on GitHub. Read the source before you install it.

Installation

Install the Matlab Use Ncap Protocol AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/automotive/matlab-use-ncap-protocol
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit.git /tmp/matlab-agentic-toolkit
mkdir -p .claude/skills
cp -r /tmp/matlab-agentic-toolkit/skills-catalog/automotive/matlab-use-ncap-protocol .claude/skills/matlab-use-ncap-protocol
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Matlab Use Ncap Protocol in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Matlab Use Ncap Protocol on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Matlab Use Ncap Protocol is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

FunctionPurposeAvailable From
ncapScenarioGenerate seed descriptor(s) from test nameR2024a
euroAssessmentStore 2026 protocol specs and scoresR2025a
configureVUTSet StabilizationTime, AssetPath on euroAssessmentR2026a
getScenarioConvert descriptor → drivingScenario or RoadRunnerR2022b
getScenarioDescriptorExtract descriptor from existing drivingScenarioR2022b
generateVariantsGenerate variant descriptors from seed + variationPropertiesR2023a
plot (ScenarioDescriptor)Plot descriptor(s), returns ScenarioDescriptorPlotR2026a
configure (ScenarioDescriptorPlot)Set GridSize, Title, SubPlotTitles, CropTypeR2026a
assessmentTableCreate empty assessment table for a testR2025a
ncapScoreCompute score from assessment table (returns struct)R2025a
ncapReportGenerate visual report figureR2025a
exportReportExport report to PDF/PNG/JPG fileR2026a
table2scenarioCreate ScenarioDescriptor from tabular data (sceneSpec, actorSpec, eventSpec)R2024a
exportScenario (roadrunner)Export from RoadRunner to OpenSCENARIOR2022a

Pattern: Seed-Only Generation

Use when you need just the seed scenario (1 descriptor), not all variants.

matlab
% 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.

matlab
% 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.

matlab
% 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.

matlab
% 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

PropertyValuesNotes
GridSize[rows cols], max product = 20Error if > 20 subplots
TitlestringFigure title
SubPlotTitlesstring arrayMust match descriptor count exactly
CropType"None", "GlobalWaypoint", "DynamicWaypoint", "RuntimeActorsCrop"Controls plot cropping

Single or small array (≤20 descriptors)

matlab
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:

matlab
% 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

matlab
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)

matlab
% 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.

matlab
% 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

matlab
% 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.

ProtocolPrefix PatternExample
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

MistakeWhy It's WrongCorrect Approach
ncapScenario("CCFtap")Short names are not validncapScenario("SA AEB CCFtap")
ncapScenario("SA AEB CCFtap") for 2026Wrong prefix for 2026 protocolncapScenario(ea, "CA FC CCFtap") with ea = euroAssessment(2026)
getScenario(d, "RoadRunner")Positional arg not supportedgetScenario(d, Simulator="RoadRunner", SimulatorInstance=rrApp)
Setting ShowProgress="No" then using fprintfDefeats built-in progressOmit ShowProgress (default is "CommandLine") or set ShowProgress="CommandLine"
Using AllScenarios=true for seed-onlyGenerates all variants unnecessarilyOmit AllScenarios for seed only
DSD export → OpenSCENARIO → importScenario for RRRoundabout, breaks pedestriansgetScenario(d, Simulator="RoadRunner", SimulatorInstance=rrApp)
Inventing VUTType or NcapYear paramsThese don't existUse configureVUT(ea, AssetPath=...) and euroAssessment(2026)
ShowProgress with euroAssessment overloadNot supported on that overloadOnly use with standalone ncapScenario(testName)
[d, info] = ncapScenario(ea, name) without AllScenarios"Too many output arguments" errorUse single output for seed, or add AllScenarios=true for two outputs
configureVUT called AFTER ncapScenarioSilently has no effect — config not appliedAlways call configureVUT BEFORE ncapScenario
SubPlotTitles count ≠ descriptor count"Invalid size of subplot titles" errorProvide exactly one title per descriptor
CropType="tight" or other invented valuesInvalid value errorUse: "None", "GlobalWaypoint", "DynamicWaypoint", or "RuntimeActorsCrop"
plot(descriptors) with GridSize > [4 5]Max 20 subplots per figureSplit array into chunks of ≤20
fprintf("%.2f", score) after ncapScorescore is a struct, not scalarAccess score.AggregateScore.Total for the numeric value
exportReport(ea, name, "report.html")HTML not supportedUse .pdf, .png, or .jpg extension
at.ImpactVelocity = ... for CCRs/CCRm/CCRb testsColumn is RelativeImpactVelocity, not ImpactVelocityCheck at.Properties.VariableNames after assessmentTable — use the actual column name
getScenario(descriptors, Simulator="RoadRunner", ...) with arrayRoadRunner only accepts one descriptor at a timeLoop: 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.


Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Matlab Use Ncap Protocol AI skill do?

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.

Why use Matlab Use Ncap Protocol on TypingMind?

Because you install it once and use it with any model. Matlab Use Ncap Protocol is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Matlab Use Ncap Protocol in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/automotive/matlab-use-ncap-protocol. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Matlab Use Ncap Protocol?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Matlab Use Ncap Protocol?

As many as you like. As long as a model supports skills, you can use Matlab Use Ncap Protocol with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Matlab Use Ncap Protocol AI skill free?

It is published on GitHub by matlab. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇