opts = jsonImportOptions()
opts = jsonImportOptions('NumVariables', numVars)
opts = jsonImportOptions(..., Name, Value)
| Parameter | Description |
|---|---|
| numVars | number of variables (default: 1). |
| Name, Value | property names and values of the object, and 'ParsingMode' ('lenient' or 'strict') which sets AllowComments, AllowInfAndNaN and AllowTrailingCommas. |
| Parameter | Description |
|---|---|
| opts | nelson.io.json.JSONImportOptions object. |
jsonImportOptions creates an import options object for JSON files, to use with readtable and readtimetable. detectImportOptions returns the same object, filled from a JSON file.
Properties:
true).The object uses the Nelson class nelson.io.json.JSONImportOptions.
f = [tempdir, 'students.json']; fid = fopen(f, 'w'); fprintf(fid, '%s', '[{"Name": {"FirstName": "Priya"}}, {"Name": {"FirstName": "Conor"}}]'); fclose(fid); opts = jsonImportOptions('VariableSelectors', "/Name/FirstName", 'TableSelector', "") T = readtable(f, opts)
| Version | Description |
|---|---|
| 2.0.0 | initial version |