MATLAB/Simulink Requirements Traceability
Overview
NirmIQ integrates seamlessly with MATLAB/Simulink Requirements Toolbox via ReqIF (Requirements Interchange Format). This enables complete requirements traceability from customer requirements through system design to Simulink implementation and testing.
- NirmIQ: Any tier (ReqIF export available in Free tier)
- MATLAB: R2019b or later
- Simulink Requirements: License required (formerly Requirements Toolbox)
- Optional: Simulink Test (for test case traceability)
Why NirmIQ + MATLAB/Simulink?
Use Cases
Automotive (ISO 26262):
- Manage customer requirements in IntelliSE
- Link system requirements to Simulink models
- Verify functional safety compliance
- Generate traceability matrices for audits
Aerospace (DO-178C):
- Requirements management in IntelliSE
- Model-based design in Simulink
- Complete traceability for certification
- Automated test case linking
Medical Devices (IEC 62304):
- Regulatory requirements in IntelliSE
- Software design in Simulink
- FDA submission traceability
- V&V documentation
Workflow Overview
graph LR
A[NirmIQ<br/>Requirements] -->|Export ReqIF| B[ReqIF File<br/>.reqif]
B -->|Import| C[MATLAB<br/>Requirements Editor]
C -->|Link| D[Simulink<br/>Model Elements]
D -->|Verify| E[Test Cases]
E -->|Report| F[Traceability<br/>Matrix]
F -->|Update| A
style A fill:#0ea5e9
style C fill:#f97316
style D fill:#f97316
style F fill:#10b981
Key Benefits:
- ✅ Bidirectional traceability
- ✅ Standards-compliant workflow
- ✅ No vendor lock-in (ReqIF standard)
- ✅ Automated link verification
- ✅ Gap analysis and coverage reports
Step-by-Step Integration Guide
Step 1: Export Requirements from IntelliSE
1.1 Prepare Your Requirements
Ensure your IntelliSE project has:
- ✅ Complete requirement hierarchy (CR001 → SYS-001 → SUB-001)
- ✅ Clear requirement text
- ✅ Proper type classification
- ✅ Status and version information
Example Structure:
CR001 - System shall detect obstacles
├── CR001.SYS-001 - Radar shall scan at 10Hz
│ └── CR001.SYS-001.SUB-001 - Signal processing algorithm
└── CR001.SYS-002 - Ultrasonic sensors backup
1.2 Export to ReqIF
- Open your project in NirmIQ
- Click Project → Export → Export to ReqIF (.reqif)
- Save the
.reqiffile (e.g.,ProjectName_Requirements_v1.0.reqif)
What's Exported:
- All requirement IDs (custom_id)
- Requirement text and descriptions
- Hierarchy (parent-child relationships)
- Attributes (type, status, version, Jira links)
- Metadata (project name, export timestamp)
Include version number in filename (e.g., ADAS_Requirements_v2.1.reqif) for change tracking.
Step 2: Import ReqIF into MATLAB Requirements Toolbox
2.1 Open MATLAB Requirements Editor
Option A - Command Line:
slreq.editor
Option B - GUI:
- Open MATLAB
- Click Apps tab
- Under Verification, Validation, and Test → Requirements Editor
2.2 Import ReqIF File
- In the Requirements Editor, click Import
- In the Importing Requirements dialog:
Document Settings:
- Document type:
ReqIF file (*.reqif or *.reqifz) - Document location: Browse to your exported
.reqiffile - Source tool: Select
Generic(orCustomif creating mapping)
Attribute Mapping:
- Default mapping: NirmIQ attributes map automatically:
custom_id→ Requirement IDtext→ Summarytype→ Type (Functional, Information, etc.)status→ Statusversion→ Version
Source Links:
- ✅ Check Import links to preserve requirement relationships
- This maintains parent-child hierarchy from IntelliSE
Specifications:
- Single specification: Import entire project as one set
- Multiple specifications: If ReqIF contains multiple projects, choose to:
- Import selected specification only
- Combine all into one set
- Import each into separate sets
Destination:
- Save as: Browse location for requirement set (e.g.,
ProjectName_Requirements.slreqx) - Allow updates from external source:
- ✅ Check if managing requirements in NirmIQ (recommended)
- ❌ Uncheck for full migration to MATLAB
- Click Import
Expected Result:
- New requirement set created (
.slreqxfile) - Hierarchy preserved
- All attributes mapped
- Requirements ready for linking
2.3 Verify Import
- In Requirements Editor, expand the requirement tree
- Verify hierarchy matches IntelliSE structure
- Check requirement IDs, text, and attributes
- Inspect Properties pane (right side) for details
Common Issues:
| Issue | Solution |
|---|---|
| Attributes missing | Customize attribute mapping in import dialog |
| Hierarchy flat | Ensure "Import links" was checked |
| Special characters corrupted | Use UTF-8 encoding in ReqIF export |
| Custom fields not imported | Map custom attributes in Attribute Mapping section |
Step 3: Link Requirements to Simulink Model Elements
3.1 Open Your Simulink Model
open_system('your_model_name')
Or double-click .slx file in MATLAB Current Folder browser.
3.2 Enable Requirements Perspective
- In Simulink Editor, click Perspectives icon (lower-right corner)
- Select Requirements
This opens:
- Requirements Browser (left pane)
- Model (center)
- Property Inspector (right pane)
3.3 Load Requirement Set
If not already loaded:
- In Requirements Browser, click Load button
- Browse to your
.slreqxfile - Requirement tree appears in browser
3.4 Create Links (Drag-and-Drop Method)
Link a requirement to a block:
- Select requirement in Requirements Browser (e.g.,
CR001.SYS-001) - Drag it onto a Simulink block (e.g.,
Radar Signal Processingsubsystem) - A Requirements icon (📋) appears on the block
Link Types:
- Implements: Block implements the requirement (most common)
- Derives From: Requirement derived from another
- Refines: Block refines the requirement
- Custom: Define your own link type
To set link type:
- Right-click the block
- Requirements → Open Outgoing Links
- In Outgoing Links dialog, select link
- Change Link Type dropdown
- Add Description (optional)
- Click OK
3.5 Create Links (Context Menu Method)
Alternative method for precise linking:
- Select a Simulink block/subsystem
- Right-click → Requirements → Link to Selection in Requirements Browser
- In Requirements Browser, select the requirement
- Link created automatically
3.6 Bulk Linking (MATLAB Script)
For large models, automate linking with scripts:
% Load requirement set
rs = slreq.load('ProjectName_Requirements.slreqx');
% Get reference to model
model = 'your_model_name';
% Create link
% Syntax: slreq.createLink(source, destination)
% Source: Simulink element path
% Destination: Requirement object
% Example: Link requirement to subsystem
req = rs.find('Id', 'CR001.SYS-001');
elementPath = [model '/Radar_Signal_Processing'];
link = slreq.createLink(elementPath, req);
link.Type = 'Implements';
link.Description = 'Implements radar signal processing requirement';
% Save changes
rs.save();
Batch Linking Example:
% Link multiple requirements to corresponding blocks
reqIDs = {'CR001.SYS-001', 'CR001.SYS-002', 'CR001.SYS-003'};
blockPaths = {
'model/Radar_Processing',
'model/Ultrasonic_Processing',
'model/Sensor_Fusion'
};
rs = slreq.load('Requirements.slreqx');
for i = 1:length(reqIDs)
req = rs.find('Id', reqIDs{i});
if ~isempty(req)
link = slreq.createLink(blockPaths{i}, req);
link.Type = 'Implements';
end
end
rs.save();
disp('Linking complete!');
3.7 Navigate Links
From Requirement to Model:
- Select requirement in Browser → Linked blocks highlight in model
From Block to Requirements:
- Select block → Click Requirements icon → View linked requirements
- Or: Property Inspector shows all outgoing links
Show/Hide Link Annotations:
- Requirements tab → Annotation section
- Toggle ID, Summary, Link Type visibility
Step 4: Verify Traceability and Coverage
4.1 Traceability Matrix
Open Traceability Matrix:
- In Requirements Editor, click Views → Traceability Matrix
- Configure:
- Rows: Requirements (from your set)
- Columns: Model elements (from Simulink model)
- Show: Links, coverage gaps
Matrix View:
| Radar Block | Ultrasonic | Fusion |
CR001.SYS-001 | ✓ | | |
CR001.SYS-002 | | ✓ | |
CR001.SYS-003 | ✓ | ✓ | ✓ |
CR001.SYS-004 | | | | ← GAP!
Export Matrix:
- Click Export → Excel, Word, or PDF
- Use for design reviews and audits
4.2 Highlight Unlinked Elements
Find gaps in model:
- In Simulink, Requirements tab → Highlight Model
- Select highlighting criteria:
- Unlinked elements: Red
- Linked elements: Green
- Partially satisfied: Yellow
Fix gaps:
- Click unlinked (red) blocks
- Link to appropriate requirements
- Re-run highlighting to verify
4.3 Coverage Report
Generate coverage report:
% Load requirement set
rs = slreq.load('Requirements.slreqx');
% Generate report
rpt = slreq.report(rs, 'model_name');
% Open report (HTML format)
web(rpt, '-browser');
Report Contents:
- Requirements with/without links
- Model elements with/without requirements
- Coverage percentage
- Traceability gaps
- Link type distribution
Step 5: Link Requirements to Test Cases
5.1 Create Test Cases (Simulink Test)
Prerequisite: Simulink Test license
Create test file:
- In Simulink, Apps → Simulink Test
- Test Manager opens
- Create Test File (
.mldatx) - Add Test Suite and Test Cases
Example Test Case:
Test Suite: Radar Processing Tests
├── Test Case 1: Verify 10Hz scan rate
├── Test Case 2: Verify detection range 100m
└── Test Case 3: Verify obstacle classification
5.2 Link Tests to Requirements
In Test Manager:
- Select test case
- In Properties pane, find Requirements section
- Click Add Link
- Browse to requirement (e.g.,
CR001.SYS-001) - Set link type: Verifies
- Save
Script-based linking:
% Load test file
tf = sltest.testmanager.load('RadarTests.mldatx');
% Get test case
tc = tf.getTestCaseByName('Verify 10Hz scan rate');
% Load requirement set
rs = slreq.load('Requirements.slreqx');
req = rs.find('Id', 'CR001.SYS-001');
% Create verification link
link = slreq.createLink(tc, req);
link.Type = 'Verifies';
% Save
rs.save();
5.3 Verification Matrix
Complete traceability chain:
Requirement → Implementation → Verification
CR001.SYS-001 → Radar Block → Test Case 1 (Verifies)
Generate V&V report:
slreq.generateReport(rs, 'Format', 'html', 'IncludeTests', true);
Advanced Workflows
Bidirectional Updates (Round-Trip)
Scenario: Requirements change in IntelliSE after initial import to MATLAB.
Update Workflow:
- Update requirements in NirmIQ
- Export new ReqIF (v2.0)
- In MATLAB Requirements Editor:
- Select requirement set
- Click Update from Source
- Browse to new ReqIF file
- Review changes in diff view
- Accept/reject changes
- Links preserved (MATLAB maintains links through requirement IDs)
Best Practices:
- ✅ Keep requirement IDs stable (don't renumber)
- ✅ Use version control for ReqIF files
- ✅ Document changes in requirement descriptions
- ✅ Re-run coverage reports after updates
Custom Attribute Mapping
Scenario: IntelliSE has custom fields (e.g., safety_level, verification_method)
Create Custom Mapping:
- During ReqIF import, click Customize in Attribute Mapping
- Add Custom Attributes:
- Name:
SafetyLevel - Type:
StringorEnumeration - Map to ReqIF attribute:
safety_level
- Name:
- Save mapping as
.jsonor.xml - Reuse for future imports
View custom attributes in MATLAB:
- Select requirement
- Property Inspector → Custom Attributes section
Integration with Embedded Coder
Generate production code with traceability:
-
Configure model for code generation:
set_param('model_name', 'RTWInlineParameters', 'on');
set_param('model_name', 'GenerateTraceInfo', 'on'); -
Generate code:
slbuild('model_name'); -
Traceability in generated code:
- Code comments include requirement IDs
- HTML report links code to requirements
- Bidirectional navigation (code ↔ model ↔ requirements)
Example generated code:
/* Requirement: CR001.SYS-001
* Description: Radar shall scan at 10Hz
* Implemented by: Radar_Signal_Processing subsystem
*/
void Radar_Signal_Processing_step(void) {
// Implementation...
}
Multi-Model Traceability
Scenario: Large system with multiple Simulink models (e.g., Powertrain, Chassis, ADAS)
Approach:
- Export complete requirement set from IntelliSE (all subsystems)
- Import once into MATLAB
- Link different requirements to different models:
CR001.PWR-*→Powertrain_Model.slxCR001.CHA-*→Chassis_Model.slxCR001.ADAS-*→ADAS_Model.slx
Consolidated reporting:
% Generate report across multiple models
models = {'Powertrain_Model', 'Chassis_Model', 'ADAS_Model'};
rs = slreq.load('Complete_Requirements.slreqx');
for i = 1:length(models)
rpt = slreq.report(rs, models{i});
% Reports saved to current folder
end
Real-World Use Case: Automotive ADAS
Scenario
Developing Advanced Driver Assistance System (ADAS) for autonomous emergency braking.
Requirements Breakdown
IntelliSE Project Structure:
CR001 - ADAS shall prevent collisions
├── CR001.SYS-001 - System shall detect obstacles within 100m
│ ├── CR001.SYS-001.SUB-001 - Radar sensor processing
│ ├── CR001.SYS-001.SUB-002 - Camera fusion algorithm
│ └── CR001.SYS-001.SUB-003 - Object classification
├── CR001.SYS-002 - System shall calculate time-to-collision
│ └── CR001.SYS-002.SUB-001 - TTC algorithm (ISO 26262 ASIL-D)
└── CR001.SYS-003 - System shall apply brakes when TTC < 2s
├── CR001.SYS-003.SUB-001 - Brake actuator control
└── CR001.SYS-003.SUB-002 - Driver warning HMI
Simulink Model Structure
ADAS_Controller.slx
├── Sensor_Fusion (implements CR001.SYS-001)
│ ├── Radar_Processing (implements CR001.SYS-001.SUB-001)
│ ├── Camera_Processing (implements CR001.SYS-001.SUB-002)
│ └── Object_Classifier (implements CR001.SYS-001.SUB-003)
├── TTC_Calculator (implements CR001.SYS-002)
│ └── TTC_Algorithm (implements CR001.SYS-002.SUB-001)
└── Brake_Controller (implements CR001.SYS-003)
├── Brake_Actuator (implements CR001.SYS-003.SUB-001)
└── HMI_Warning (implements CR001.SYS-003.SUB-002)
Implementation Steps
1. Export from IntelliSE:
File: ADAS_Emergency_Braking_v1.2.reqif
Size: ~45KB
Requirements: 47 total (8 customer, 15 system, 24 subsystem)
2. Import to MATLAB:
% Import ReqIF
slreq.editor
% GUI: Import → ADAS_Emergency_Braking_v1.2.reqif
% Save as: ADAS_Requirements.slreqx
3. Link to Model (Scripted):
rs = slreq.load('ADAS_Requirements.slreqx');
model = 'ADAS_Controller';
% Define mapping
links = {
'CR001.SYS-001', 'ADAS_Controller/Sensor_Fusion';
'CR001.SYS-001.SUB-001', 'ADAS_Controller/Sensor_Fusion/Radar_Processing';
'CR001.SYS-001.SUB-002', 'ADAS_Controller/Sensor_Fusion/Camera_Processing';
'CR001.SYS-001.SUB-003', 'ADAS_Controller/Sensor_Fusion/Object_Classifier';
'CR001.SYS-002', 'ADAS_Controller/TTC_Calculator';
'CR001.SYS-002.SUB-001', 'ADAS_Controller/TTC_Calculator/TTC_Algorithm';
'CR001.SYS-003', 'ADAS_Controller/Brake_Controller';
'CR001.SYS-003.SUB-001', 'ADAS_Controller/Brake_Controller/Brake_Actuator';
'CR001.SYS-003.SUB-002', 'ADAS_Controller/Brake_Controller/HMI_Warning';
};
% Create all links
for i = 1:size(links, 1)
req = rs.find('Id', links{i,1});
if ~isempty(req)
link = slreq.createLink(links{i,2}, req);
link.Type = 'Implements';
fprintf('Linked %s → %s\n', links{i,1}, links{i,2});
end
end
rs.save();
disp('All requirements linked successfully!');
4. Create Test Cases:
% Create test file
tm = sltest.testmanager;
tf = tm.createTestFile('ADAS_Tests');
ts = tf.createTestSuite('Emergency_Braking_Tests');
% Test Case 1: Obstacle detection at 100m
tc1 = ts.createTestCase('scenario', 'Detect_Obstacle_100m');
tc1.assignToBaseWorkspace('obstacle_distance', 100);
% Link to requirement
req = rs.find('Id', 'CR001.SYS-001');
link = slreq.createLink(tc1, req);
link.Type = 'Verifies';
% Test Case 2: TTC calculation accuracy
tc2 = ts.createTestCase('scenario', 'Verify_TTC_Calculation');
req = rs.find('Id', 'CR001.SYS-002.SUB-001');
link = slreq.createLink(tc2, req);
link.Type = 'Verifies';
% Test Case 3: Brake activation at TTC < 2s
tc3 = ts.createTestCase('scenario', 'Brake_Activation_TTC_2s');
req = rs.find('Id', 'CR001.SYS-003');
link = slreq.createLink(tc3, req);
link.Type = 'Verifies';
tf.saveToFile('ADAS_Tests.mldatx');
disp('Test cases created and linked!');
5. Generate Traceability Report:
% Coverage report
rpt = slreq.report(rs, model);
web(rpt, '-browser');
% Results:
% - 47 requirements
% - 47 linked to model (100% coverage)
% - 15 verified by tests (32% verification coverage)
% - 0 gaps
6. ISO 26262 Compliance:
% Export traceability matrix for safety audit
slreq.generateReport(rs, ...
'Format', 'docx', ...
'IncludeLinks', true, ...
'IncludeTests', true, ...
'Title', 'ADAS Emergency Braking - Traceability Report', ...
'FileName', 'ADAS_ISO26262_Traceability.docx');
Deliverables:
- ✅ Complete requirements traceability (Req → Design → Code)
- ✅ Test verification matrix
- ✅ ISO 26262 safety documentation
- ✅ Automated regression testing
- ✅ Code generation with embedded traceability
Troubleshooting
Import Issues
| Problem | Cause | Solution |
|---|---|---|
| "Invalid ReqIF file" | Malformed XML | Validate XML structure; re-export from IntelliSE |
| Attributes not imported | Unmapped attributes | Customize attribute mapping during import |
| Hierarchy flat | Links not imported | Enable "Import links" in import dialog |
| Special characters corrupted | Encoding mismatch | Use UTF-8 encoding in ReqIF |
| Import very slow | Large file (1000+ reqs) | Split into multiple requirement sets |
Linking Issues
| Problem | Cause | Solution |
|---|---|---|
| Drag-drop not working | Perspective not enabled | Enable Requirements Perspective in Simulink |
| Links not visible | Annotations hidden | Requirements tab → Show Annotations |
| Cannot find requirement | Wrong set loaded | Load correct .slreqx in Requirements Browser |
| Link to subsystem fails | Model not saved | Save model before creating links |
| Script links fail | Incorrect element path | Use Simulink.BlockDiagram.getBlocksByName to verify paths |
Update Issues
| Problem | Cause | Solution |
|---|---|---|
| Update breaks links | Requirement IDs changed | Keep IDs stable; don't renumber requirements |
| New requirements not showing | Cache issue | Close/reopen requirement set |
| Conflicts in update | Both sources modified | Manually merge changes; document conflicts |
Best Practices
Requirements Management
✅ DO:
- Use stable, hierarchical IDs (CR001.SYS-001.SUB-001)
- Include version numbers in exports (v1.0, v1.1, etc.)
- Document requirement changes in description field
- Export regularly (after each major update)
- Keep ReqIF files in version control (Git)
❌ DON'T:
- Don't renumber requirement IDs mid-project
- Don't manually edit ReqIF XML (use tools)
- Don't skip attribute mapping customization
- Don't delete parent requirements before children
Linking Strategy
✅ DO:
- Link at appropriate abstraction level (system req → subsystem, not individual blocks)
- Use consistent link types (Implements, Verifies, Refines)
- Document rationale in link description
- Review links during design reviews
- Automate linking for large models (scripts)
❌ DON'T:
- Don't over-link (every block doesn't need a requirement)
- Don't use vague link descriptions
- Don't skip traceability matrix verification
- Don't link requirements to generated code (link to model)
Verification
✅ DO:
- Link every requirement to at least one test case
- Generate coverage reports regularly
- Highlight unlinked elements in model
- Include traceability in code reviews
- Archive reports with each release
❌ DON'T:
- Don't assume 100% model coverage = 100% requirement coverage
- Don't skip verification for "obvious" requirements
- Don't forget to update tests when requirements change
- Don't rely solely on automated tests (manual review essential)
Additional Resources
MathWorks Documentation
- Simulink Requirements - Getting Started
- Import Requirements from ReqIF
- Link Requirements to Simulink
- Requirements Traceability
- Generate Traceability Reports
NirmIQ Documentation
Standards
- ISO 26262 - Automotive Functional Safety
- DO-178C - Aviation Software
- IEC 62304 - Medical Device Software
Support
Get Help
- NirmIQ: madhu.chellappa@gmail.com
- MATLAB: MathWorks Support
- GitHub Issues: Report Integration Issues
Training
- NirmIQ Academy: academy.gannetsolutions.com
- MathWorks Training: Simulink Requirements Course
Summary
NirmIQ + MATLAB/Simulink provides complete requirements traceability from customer needs through implementation to verification:
✅ Export requirements from NirmIQ as ReqIF ✅ Import into MATLAB Requirements Toolbox ✅ Link requirements to Simulink model elements ✅ Verify with Simulink Test cases ✅ Report traceability matrices for compliance ✅ Update bidirectionally as requirements evolve
Perfect for: Automotive (ISO 26262), Aerospace (DO-178C), Medical (IEC 62304), and any model-based development requiring standards compliance.
Last Updated: October 2025 NirmIQ Version: 2.0+ MATLAB Version: R2019b+ Simulink Requirements: Required