You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
A simple utility function to export any MATLAB variable to a JSON file.
Usage
% Example data
data.name = "Alice";
data.scores = [95, 87, 76];
% Write compact JSON
writejson(data, "data.json", false);
% Write pretty-printed JSON (MATLAB R2021a or newer)
writejson(data, "prettyData.json", true); % equal to writejson(data, "prettyData.json")
Will result in
{
"name": "Alice",
"scores": [
95,
87,
76
]
}
Cite As
Joshua Bauske (2026). writeJSON (https://ch.mathworks.com/matlabcentral/fileexchange/182190-writejson), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0 (1.38 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0 |
