Json

isValidJSON(fileName)[source]

This function checks if a JSON file is valid or not. A JSON file is considered valid if it can be decoded into a structure.

USAGE

[isValid] = isValidJSON (fileName)

INPUT

fileName – A string containing the file name of the JSON file

OUTPUT

isValid – A logical variable: 1 if JSON file is valid 0 if JSON file is invalid

Example

[isValid] = isValidJSON(‘toyModel_output.json’)

model2JSON(model, fileName)[source]

This function writes a JSON file from Matlab structure. JSON files can be validated by isValidJSON function or online tools like https://jsonlint.com/.

USAGE

model2JSON (model,fileName)

INPUT

model: model structure fileName: name of file including extension .json