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
]
}
Citar como
Joshua Bauske (2025). writeJSON (https://es.mathworks.com/matlabcentral/fileexchange/182190-writejson), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Se creó con
R2025b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS LinuxEtiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
| Versión | Publicado | Notas de la versión | |
|---|---|---|---|
| 1.0.0 |
