2026-06-25 · 6 min read · Rahul Chitturi
- matlab
- simulink
- calibration
Calibration teams often exchange lookup table data as JSON because it is easy to review, generate, and store in git. Simulink, however, expects arrays, breakpoints, structs, and units to line up exactly with the model blocks that consume them.
When a model update fails or a table produces strange results, inspect the JSON shape before editing block parameters manually. The bug is usually a dimension, ordering, or unit mismatch in the handoff.
Check dimensions first
A one-dimensional table, two-dimensional map, and nested cell-like export can all look like arrays in JSON. Confirm that every row has the same length and that breakpoint vectors match the table dimensions expected by the Simulink block.
- Count rows and columns before generating MATLAB literals
- Confirm row-major versus column-major expectations
- Reject ragged arrays before they reach model scripts
- Keep breakpoint names beside the data they describe
Preserve units and metadata
Numeric arrays alone rarely explain a calibration. Units, axis names, valid ranges, and source identifiers belong in the same reviewed payload. If metadata lives in a separate spreadsheet or email, teams can paste the right numbers into the wrong model context.
- Store units for each axis and output table
- Record source version or calibration ticket IDs
- Validate min and max ranges before conversion
- Represent missing values explicitly instead of leaving blanks
Diff generated MATLAB, not only JSON
Two JSON files may differ in formatting while producing identical MATLAB, or they may look similar while changing generated struct fields. Compare both the source JSON and the generated MATLAB code when reviewing a calibration update.
This extra check catches renamed fields, reordered axes, and precision changes before they land in a model file that is harder to review.
A Flashman workflow
Validate and format the JSON payload, convert numeric arrays to MATLAB syntax, convert metadata objects to structs, then diff the generated output against the last approved calibration. Keep the data local while you review proprietary model parameters.
For repeat handoffs, define a small JSON schema outside the tool and reject data that does not include expected dimensions, units, and identifiers. Flashman helps with the local inspection loop before the data reaches MATLAB or Simulink.