Black FridayUpgrade your career this Black Friday. Get up to ₹60,000 Scholarship on IIT programsUp to ₹60K Black Friday Scholarship52 seats leftOffer ends Fri, 27 Nov, 11:59 pm IST.

Black Friday Scholarship – IIT Jammu & IIT Roorkee

The best Black Friday deal isn't a gadget. It's your next career move.

Get up to ₹60,000 Black Friday Scholarship on our PG programs with IIT Jammu and iHUB DivyaSampark, IIT Roorkee. IIT certification, 12 live sessions with IIT faculty and 100% placement assistance.

Only 52 seats left. Offer ends Fri, 27 Nov, 11:59 pm IST

3,905 engineers placed since 2019 · 1,276 hiring companies

By submitting you agree to our Terms and Privacy Policy.

Your free demo class is requested

Browse courses

Simulink Data Dictionary (SLDD): Create, Link, Migrate and Script It

What a Simulink Data Dictionary (.sldd) holds, how to create and link one, migrate base-workspace variables, share data across models with referenced dictionaries, script it with the Simulink.data.dictionary API, and diff and merge it under version control, including the R2026b JSON format.

Simulink Data Dictionary (SLDD): Create, Link, Migrate and Script It

A Simulink Data Dictionary (SLDD) is a .sldd file that permanently stores the design data a Simulink model needs: parameters, signal objects, bus definitions, enumerated types, configuration sets and code-generation definitions. It lives outside the model and outside the MATLAB base workspace. You link a model to it from Modeling > Link to Data Dictionary, or with set_param(model,'DataDictionary','myData.sldd'), and every model linked to the same dictionary reads the same definitions. It does not store simulation inputs and outputs.

In short

  • An .sldd has five sections: Design Data, Configurations, Embedded Coder, Architectural Data and Other Data (MathWorks, "What Is a Data Dictionary?", R2026b documentation).
  • When Simulink resolves a name, it searches mask workspaces first, then the model workspace, then the linked data dictionary (or the base workspace if there is no dictionary) (MathWorks, "Symbol Resolution").
  • The scripting API, Simulink.data.dictionary.create and Simulink.data.dictionary.open, has been documented since R2015a. Simulink.data.dictionary.closeAll refuses to close a dictionary with unsaved changes unless you pass '-save' or '-discard'.
  • New in R2026b: a dictionary can be saved as uncompressed JSON text instead of compressed binary (both keep the .sldd extension), which makes Git diffs smaller. Binary is still the default.
  • Since R2026a, visdiff on two .sldd files can return a comparison object that you can publish as a report.

This guide is for engineers and students doing model-based design (MBD) in Simulink, typically for automotive controls, AUTOSAR or Embedded Coder projects, who have outgrown a load params.mat in a callback. If Simulink is new to you, start with how MATLAB and Simulink differ and the MATLAB and Simulink Basics course. To compare Skill-Lync's courses, see every MATLAB and Simulink course, from short courses to EV, embedded and CAE programs, with fees, duration and projects in one table. Every function name below comes from the MathWorks documentation in the sources. The snippets use only documented calls but were not run on every release, so check the reference page for your version.

What is a Simulink data dictionary (SLDD)?

A Simulink data dictionary is a persistent repository for the data a model depends on. It holds design data, meaning the values and types that define parameters, signals and model behaviour. Models linked to it read that data during simulation and code generation. It survives a MATLAB restart, records who changed which entry and when, and can be shared between models.

Think of the base workspace as a whiteboard. Anyone can write on it, nothing says which model owns which variable, and it is wiped when MATLAB closes, so teams end up reloading it from MAT-files and scripts in a model callback. A data dictionary is the bound logbook instead. Every entry has an owner file, a history and a fixed place.

What a dictionary does not hold is simulation data: the inputs and outputs that enter and leave the model through Inport and Outport blocks, such as timeseries test vectors. Those stay in the workspace, a MAT-file or a test harness. A Simulink data dictionary is also unrelated to MATLAB's own dictionary data type, despite the name.

What is inside an .sldd file?

Every .sldd file is divided into sections, and each section accepts a different kind of data. Most of your work happens in Design Data and Configurations. The other three matter once you generate code or build architecture models.

Diagram of one .sldd file with five sections: Design Data holds Simulink.Parameter, Simulink.Signal, Simulink.Bus and enumerated types; Configurations holds Simulink.ConfigSet and Simulink.VariantConfigurations; Embedded Coder holds storage classes, memory sections and function templates; Architectural Data holds port interfaces, data types and constants; Other Data holds reference information. Simulation data is not stored.
The five sections of a Simulink data dictionary and the tool used to edit each. Source: MathWorks, "What Is a Data Dictionary?" (R2026b). Drawn by Skill-Lync.
  • Design Data: variables and data types that define parameters, signals and behaviour, such as Simulink.Parameter, Simulink.Signal, Simulink.Bus, fixed-point fi values, plain numeric variables and enumerated type definitions. Only certain classes are allowed here.
  • Configurations: configuration sets (Simulink.ConfigSet) and variant configuration objects (Simulink.VariantConfigurations). Models use a stored configuration set through a configuration reference.
  • Embedded Coder: the Embedded Coder Dictionary, holding code definitions such as storage classes, memory sections and function customization templates. You edit it in the Embedded Coder Dictionary tool, not in Model Explorer.
  • Architectural Data: shared definitions for Simulink and architecture models, such as port interfaces, data types and system-wide constants, edited in the Architectural Data Editor.
  • Other Data: reference information that simulation does not use, such as notes on test equipment. It accepts almost any class, with a few exceptions (for example arrays of objects).

Data dictionary vs base workspace vs model workspace: where should model data live?

Use the base workspace for quick experiments, the model workspace for data only one model uses, and a data dictionary for anything shared between models, anything a team edits, and anything that must be tracked. That is the split MathWorks recommends in its guide to storing data: keep data as local as possible, and put shared items such as bus objects and configuration sets in a dictionary.

LocationWho can see itSurvives a restart?Best forLimits
Base workspaceEvery open modelNo, unless saved to a MAT-file or scriptLearning, quick prototypesNo ownership or tracking; does not scale to multi-model projects
Model workspaceOne modelYes, saved inside the model fileData local to one model, portabilityCannot hold Simulink.Bus objects; signal objects with a non-Auto storage class are not allowed for code generation
Linked MAT-file (R2024b+)Models linked to itYesShared numeric values, data types and some data objectsNo change tracking, no requirements links
Data dictionary (.sldd)Models linked to it, plus referenced dictionariesYesShared, team and multi-model data; code generationA little more setup

Which value wins when a name exists in two places? Simulink searches from the block outwards: mask workspaces first, then the model workspace of the model containing the block, then the linked data dictionary. If the model has no dictionary, the last step is the base workspace. If the dictionary's Enable dictionary access to base workspace property is selected, Simulink treats the dictionary and the base workspace as one namespace. A name may then be defined in both places only if the values are identical, and the dictionary copy is used.

How do you create a Simulink data dictionary and link a model?

Open the model, go to the Modeling tab and click Link to Data Dictionary in the Design group. In the Model Properties dialog (External Data tab), click New, name and save the .sldd file, then click Apply and OK. The model is now linked to an empty dictionary. The command-line equivalent is one line per step:

dd = Simulink.data.dictionary.create('myController.sldd');
load_system('myController')
set_param('myController','DataDictionary','myController.sldd')
save_system('myController')

How do you open a Simulink data dictionary? In the Simulink Editor, click the model data badge in the bottom-left corner of the canvas, then the External Data link. The dictionary opens in Model Explorer, where you expand its node in the Model Hierarchy pane. You can also use File > Open in Model Explorer, or run dd = Simulink.data.dictionary.open('myController.sldd'); show(dd) at the command line.

To add data by hand, select the Design Data node and use the Add menu to create, for example, a Simulink Parameter or a Simulink Signal. Select the new entry and set its data type, dimensions, minimum, maximum, unit and sample time in the dialog pane on the right. To bring in an existing MAT-file or MATLAB script, right-click Design Data and choose Import from File. To get data back out, use Export to File, which writes a MAT-file or a MATLAB script.

How do you migrate base workspace variables into a data dictionary?

Link the model to a new dictionary, then click Migrate data in the Model Properties dialog and confirm with Migrate. Simulink copies every base-workspace variable the model uses into the dictionary. Variables go to Design Data and configuration sets go to Configurations. Then clear Enable model access to base workspace and remove whatever used to load the data, so nothing reaches the base workspace by accident.

Migration workflow: before, model.slx loads data.mat into the base workspace with a PreLoadFcn callback (Kp, Ki, CtrlBus, cfgSim, u_in); four steps (Link to Data Dictionary, New, Migrate data, clear base workspace access); after, model.slx is linked to data.sldd with Kp, Ki and CtrlBus in Design Data and cfgSim in Configurations. The timeseries u_in is not migrated.
Moving a model's data from the base workspace into a dictionary. Variable names are illustrative; the steps and exclusions follow MathWorks, "Migrate Models to Use Simulink Data Dictionary". Drawn by Skill-Lync.

Five things catch people out after migrating:

  • Callbacks still load data. A PreLoadFcn such as load myData keeps filling the base workspace. Delete or comment it out; the Dependency Analyzer helps you find such callbacks.
  • Scripts still write to the base workspace. Replace evalin('base',...) with Simulink.data.evalinGlobal(model,...) and use Simulink.data.assigninGlobal for writes. Both act on the dictionary or the base workspace, whichever the model uses.
  • Timeseries data is not imported. A From Workspace block that reads a timeseries will error until you point it at a source outside the dictionary.
  • Storage classes move into objects. Variables with storage class settings in the model become Simulink.Parameter objects carrying that storage class. Migrating back does not restore the old settings.
  • Implicit signal resolution is not allowed. Set the model's Signal resolution parameter to "Explicit only" or "None".

For a model reference hierarchy, link the top model and answer Change all models when Simulink offers to link the referenced models too. Migrate a model to a dictionary before you protect it. Simulation fails if the hierarchy you migrate already contains a protected model.

The same migration as a script, following the pattern in the MathWorks programmatic example:

model = 'myController';
load_system(model)

% Base-workspace variables the model actually uses
vars = Simulink.findVars(model,'SourceType','base workspace');

dd = Simulink.data.dictionary.create('myController.sldd');
importFromBaseWorkspace(dd,'varList',{vars.Name},'clearWorkspaceVars',true);
saveChanges(dd)

set_param(model,'DataDictionary','myController.sldd')
save_system(model)

This script does not move enumerated type definitions. Import those separately with importEnumTypes (next section). importFromBaseWorkspace skips names that already exist in the dictionary unless you pass 'existingVarsAction','overwrite' (or 'error' to stop instead).

Which data objects belong in a data dictionary?

Store anything that defines the design: tunable parameters and calibrations, signal and state definitions, bus types, enumerations and configuration sets. Plain numbers work too, but data objects carry the type, range, unit and code-generation settings with the value, and that is where a dictionary pays off.

Simulink.Parameter: values blocks reference

A Simulink.Parameter holds a value that one or more block parameters reference by name, for example a controller gain, a limit or a lookup table's breakpoints. Its DataType defaults to 'auto', which takes the type from the blocks that use it. Min and Max are checked: a value outside them gives a warning when you set it and an error when you update or simulate the model.

Kp = Simulink.Parameter(0.8);
Kp.DataType = 'single';
Kp.Min = 0;
Kp.Max = 5;
Kp.Description = 'Speed loop proportional gain';

Kp.CoderInfo.StorageClass decides how the generated code allocates the parameter, for example as a global calibration variable or an inlined constant.

Simulink.Signal: named signals and states

A Simulink.Signal fixes or checks the attributes of a signal line or a discrete state (data type, dimensions, min, max, unit, sample time, initial value). It applies when the line or state has the same name as the object and the line is set to resolve to a signal object (MustResolveToSignalObject set to 'on').

Bus objects: interfaces between components

A Simulink.Bus defines the element names, order and types of a bus, much like a C struct, and Simulink checks connected buses against it. Bus objects cannot be stored in a model workspace, so a dictionary (or the base workspace) is where shared interfaces belong.

Enumerations

Enumerated types are stored as Simulink.data.dictionary.EnumTypeDefinition entries. Define them with Simulink.defineIntEnumType (shown in the syntax of the current reference page) or a classdef file, then import them:

Simulink.defineIntEnumType("GearMode", ...
    "Members",{ {"Park",0}, {"Reverse",1}, {"Neutral",2}, {"Drive",3} }, ...
    StorageType="uint8", DefaultValue="Park");
importEnumTypes(dd,{'GearMode'});

Clear any base-workspace variables of that type first, or the import fails. If the type came from a classdef file, importEnumTypes renames that file with a .save suffix so it cannot conflict with the dictionary copy. Note that importEnumTypes saves the dictionary as it imports.

Configuration sets

Store one freestanding configuration set (solver, step size, code-generation target) in the Configurations section and give each model a configuration reference to it. Changes then apply to every model that references it. You save them by saving the dictionary. Configuration references cannot be nested beyond the second reference.

How do referenced dictionaries make Simulink models reusable?

A dictionary can reference other dictionaries. The referencing dictionary sees every entry of the dictionaries it references, but the referenced dictionary does not see the referencing one's data unless it has a reference back. That one-way visibility is what lets you split a project into reusable pieces. Shared types live in one file, each component's own data lives in another, and a component carries its data with it into the next project.

Reference hierarchy: GlobalShare.sldd holds CtrlBus, SensorBus, rho and SimConfigSet and is linked to the top model ex_SystemModel; Plant.sldd and Controller.sldd each reference GlobalShare.sldd with addDataSource and are linked to the component models ex_PlantComp_Lvl1 and ex_ContrComp.
A shared dictionary referenced by component dictionaries, after MathWorks' example "Partition Data for Model Reference Hierarchy Using Data Dictionaries" (model and dictionary names from that example). Drawn by Skill-Lync.

In MathWorks' example, the system-wide items (CtrlBus, SensorBus, rho and the configuration set) go into GlobalShare.sldd. Plant.sldd and Controller.sldd each reference it, and each component model links to its own dictionary. Changes to shared items happen in one file. Changes to controller-only data such as init happen in Controller.sldd, so two engineers rarely edit the same file. To decide what is shared, use Find Where Used in Model Explorer or Simulink.findVars on each model and intersect the results.

Rules that keep a hierarchy healthy:

  • Give each component interface its own types dictionary. MathWorks recommends storing the data types of each reusable component's interface in a separate dictionary linked to that model or library. A new project then references the same file instead of copying bus definitions.
  • Avoid duplicates. The same name may be defined in two dictionaries of one hierarchy only if class and values are identical. When the Diagnostic Viewer reports inconsistent definitions, Update others to match makes the copies follow the one you choose.
  • See where an entry lives. Add the DataSource column in Model Explorer. You can move an entry to a referenced dictionary by changing its DataSource or by dragging it. In scripts, getEntry(s,name,'DataSource','Plant.sldd') picks the copy from one dictionary.
  • Keep referenced files on the MATLAB path. addDataSource requires it. From R2026b, opening a dictionary whose referenced dictionary is missing gives a warning instead of an error.
  • Check the tree. View Hierarchy on the Referenced Dictionaries list opens the Dependency Analyzer.

How do you script a data dictionary with the MATLAB API?

The API has three object levels. Simulink.data.dictionary.open or create returns a Simulink.data.Dictionary. getSection returns a Simulink.data.dictionary.Section. getEntry returns a Simulink.data.dictionary.Entry, whose value you read and write with getValue and setValue. Nothing reaches the file until you call saveChanges.

API object chain: Simulink.data.dictionary.open returns a Simulink.data.Dictionary (getSection, addDataSource, importFromBaseWorkspace, importEnumTypes, saveChanges, discardChanges, close); getSection returns a Simulink.data.dictionary.Section (addEntry, getEntry, exist, deleteEntry, find, evalin, assignin, exportToFile, importFromFile); getEntry returns a Simulink.data.dictionary.Entry (getValue, setValue, discardChanges, showChanges).
Dictionary, section and entry objects and their main functions, from the MathWorks reference pages for each class. Drawn by Skill-Lync.

A complete example: a shared types dictionary, a component dictionary that references it, a parameter, a later edit, and a clean close.

% 1. Shared types dictionary with one bus
types = Simulink.data.dictionary.create('VehicleTypes.sldd');
tSec  = getSection(types,'Design Data');
el(1) = Simulink.BusElement; el(1).Name = 'speed';  el(1).DataType = 'single';
el(2) = Simulink.BusElement; el(2).Name = 'torque'; el(2).DataType = 'single';
SensorBus = Simulink.Bus; SensorBus.Elements = el;
addEntry(tSec,'SensorBus',SensorBus);
saveChanges(types)

% 2. Component dictionary that references the shared one
ctrl = Simulink.data.dictionary.create('Controller.sldd');
addDataSource(ctrl,'VehicleTypes.sldd');   % Controller.sldd now sees SensorBus
cSec = getSection(ctrl,'Design Data');
Kp = Simulink.Parameter(0.8); Kp.DataType = 'single';
addEntry(cSec,'Kp',Kp);
saveChanges(ctrl)

% 3. Change a value later
if exist(cSec,'Kp')
    e = getEntry(cSec,'Kp');
    p = getValue(e); p.Value = 1.2; setValue(e,p);
    saveChanges(ctrl)
end

% 4. Close every open dictionary connection
Simulink.data.dictionary.closeAll('-save')

Other calls worth knowing:

  • Simulink.data.dictionary.closeAll closes all connections, or one dictionary if you pass its file name. Without '-save' or '-discard' it errors when there are unsaved changes. It is handy at the start and end of test scripts, so no dictionary stays open between runs.
  • discardChanges(dd) reverts everything since the last save. showChanges on an entry shows what changed, and each entry carries Status, LastModified and LastModifiedBy.
  • exportToFile(s,'designData.m') writes a section to a MATLAB script (or .mat), including entries from referenced dictionaries. Enumerated types are not exported this way. importFromFile does the reverse.
  • To edit a configuration set held in the dictionary, get its entry from getSection(dd,'Configurations'), copy it with getValue, change it with set_param (for example 'StopTime'), write it back with setValue and call saveChanges.
  • exportToVersion saves a copy that an older MATLAB release can open.

How does the data dictionary work with Embedded Coder?

For production code generation, the dictionary carries two things. The first is each data object's own code settings, such as the storage class in CoderInfo.StorageClass. The second is an Embedded Coder Dictionary in the Embedded Coder section, with the storage classes, memory sections and function customization templates every linked model can use. Open it with coder.dictionary.open('Controller.sldd') (Embedded Coder, R2019b and later), or from the Embedded Coder Dictionary tool. The Simulink.data.dictionary.Section API cannot reach the Embedded Coder section. Sharing one Embedded Coder Dictionary means every linked model generates code against the same storage class and memory section definitions. Skill-Lync's Introduction to Model-Based Development using MATLAB and Simulink course covers creating and accessing a Simulink Data Dictionary alongside MIL and SIL testing. The Automotive Embedded Systems and AUTOSAR course has a week that includes data dictionary creation. If you are preparing for those roles, the AUTOSAR interview questions post shows where this fits.

How do you version-control, diff and merge an .sldd?

Treat the .sldd like a model file. Commit it, compare it with MathWorks' Comparison Tool, and never merge it with a plain text merge. Until R2026b a dictionary was always compressed binary, so Git could store it but not show a meaningful line diff.

  • R2026b JSON format. A dictionary can now be saved as uncompressed JSON text. Set it per dictionary in Model Explorer or with the FileFormat property ("uncompressed-text"), or make it the default for new dictionaries with set_param(0,"SLDDFileFormat","uncompressed-text"). Later commits then store only diffs, so the repository grows more slowly. MathWorks warns that editing the JSON outside Simulink can make the file fail to load, and that the Model Testing Dashboard and Dependency Analyzer do not support JSON dictionaries.
  • Diff. visdiff('Controller_v1.sldd','Controller_v2.sldd') opens the Comparison Tool for dictionaries in either format. From R2026a it can return a comparison object that you pass to publish to produce a report, which is useful in code review.
  • Merge. Configure Git to use MATLAB's tools with comparisons.ExternalSCMLink.setup(), then resolve conflicts with git mergetool -t mlMerge. MathWorks' R2026a notes say the System Composer Comparison and Three-Way Merge tools can merge data dictionaries and resolve conflicts in them.
  • Reduce conflicts by design. The reference hierarchy above is also a version-control strategy. If shared types, controller data and plant data live in separate files with separate owners, most changes never touch the same file.
  • Mixed releases. To hand a dictionary to someone on an older release, use Export to Previous Version or exportToVersion. Exports to releases before R2026b are written in compressed binary.

Common Simulink data dictionary errors and how to fix them

SymptomLikely causeFix
closeAll errors instead of closingA dictionary has unsaved changesSimulink.data.dictionary.closeAll('-save') or ('-discard')
A variable "comes back" in the base workspace after migrationA model callback such as PreLoadFcn still loads a MAT-fileRemove the load from the callback; clear Enable model access to base workspace
Inconsistent or duplicate definitions reportedSame name in the base workspace and the dictionary, or in two dictionaries, with different valuesKeep one definition; use Update others to match; check the DataSource column
A script cannot find an entryWrong section, a typo, or the entry lives in a referenced dictionaryCheck with exist(s,name); use getEntry(...,'DataSource',file); confirm the section is 'Design Data'
Scripts read stale valuesevalin('base',...) no longer reaches the model's dataUse Simulink.data.evalinGlobal / assigninGlobal
Referenced dictionary not found / "unable to find data dictionary"File not on the MATLAB path, or a stale link in External DataAdd the folder to the path; check Model Properties > External Data; run closeAll and reopen
"Dictionary entry value class ... is undefined"An entry uses a custom class (for example a storage-class package) that is not on the pathAdd the package folder to the path before opening
importEnumTypes failsBase-workspace variables of that type still existClear them, then import
Model errors on signal resolution after linkingImplicit signal resolution is not allowed with a dictionarySet Signal resolution to "Explicit only" or "None"
Colleague cannot open your dictionarySaved in a newer releaseExport to Previous Version / exportToVersion

The "unable to find data dictionary" and "class is undefined" rows come from MathWorks Answers threads, not the reference documentation. Treat their fixes as reported workarounds.

Frequently asked questions

What does SLDD stand for?

SLDD stands for Simulink Data Dictionary, and .sldd is its file extension. Engineers use "SLDD" for both the feature and the file. It is the MathWorks container for a model's design data: parameters, signals, buses, enumerations, configuration sets and Embedded Coder definitions.

Can one Simulink model use more than one data dictionary?

A model's DataDictionary parameter names one .sldd file. To use data from several dictionaries, make that dictionary reference the others (addDataSource or Referenced Dictionaries > Add in Model Explorer). The model then sees the whole hierarchy.

Is the data dictionary part of base Simulink?

Yes. Data dictionaries and the Simulink.data.dictionary API are documented in the Simulink documentation, not in a separate toolbox. The Embedded Coder section and coder.dictionary.open need Embedded Coder. For licence options in India, see whether MATLAB is free for students.

Can I edit an .sldd file in a text editor?

Not safely. Before R2026b the file is compressed binary. From R2026b you can save it as JSON text so that diffs are readable, but MathWorks warns that hand-editing can corrupt its structure and stop it loading. Edit through Model Explorer, the Type Editor or the API.

How do I close all open data dictionaries?

Run Simulink.data.dictionary.closeAll. Add '-save' to keep unsaved changes or '-discard' to drop them. Pass a file name (not a full path) to close just one dictionary, for example Simulink.data.dictionary.closeAll('Controller.sldd','-discard').

Sources and further reading

Want this on your résumé?

Talk to a counsellor.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.