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
]
}
Citation pour cette source
Joshua Bauske (2026). writeJSON (https://fr.mathworks.com/matlabcentral/fileexchange/182190-writejson), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Créé avec
R2025b
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS LinuxTags
Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.0.0 |
