simple_JsonDecode

버전 1.2 (5.96 KB) 작성자: L Pir
Decodes a Json-file and returns a MATLAB-struct, suited for oder MATLAB versions (<2017)
다운로드 수: 66
업데이트 날짜: 2021/8/5

simple json-decode

simple_JsonDecode.m View simple_JsonDecode on File Exchange is a json-file parser written in MATLAB. It reads a json-file and returns the fields as a MATLAB-struct. This script is suited for oder MATLAB versions (<2017) In newer MATLAB versions, the 'jsondecode'-command should be available as a built-in function.
Advantage: No compilation needed!

Usage:

simple_JsonDecode(jsonFilePath) or simple_JsonDecode to open a UI-menu for selecting a json file

Input: jsonFilePath: full path of json file
Output: MATLAB-struct

Assumed format of json-file:

  "FIELDNAME1": DOUBLE,
  "FIELDNAME2": "STRING",
  "FIELDNAME3": [ARRAYVALUE1,ARRAYVALUE2],

Example:

simple_JsonDecode('jsonfile_example.json')

expected output:

ans = 
struct with fields:

                          Modality: 'MR'
             MagneticFieldStrength: 1.5000
                  ImagingFrequency: 63.7018
                      Manufacturer: 'Siemens'
            ManufacturersModelName: 'Symphony'
                  BodyPartExamined: 'HEAD'
                   PatientPosition: 'HFS'
          ProcedureStepDescription: 'head_general'
                 MRAcquisitionType: '2D'
                 SeriesDescription: 'localizer'
                      ProtocolName: 'localizer'
                  ScanningSequence: 'GR'
                   SequenceVariant: 'SP'

See also:

For a robust and validated json-parser using the ECMA JSON syntax standard, please visit the JSON function View simple_JsonDecode on File Exchange

If you are looking for a faster mexfile based version, please give a look at: matlab-json

인용 양식

Lukas Pirpamer (2021). simple_JsonDecode (https://github.com/lukaspirpamer/simple_JsonDecode/releases/tag/v1.0.1), GitHub. Retrieved June 21, 2021.

MATLAB 릴리스 호환 정보
개발 환경: R2021a
R2017a에서 R2021a까지의 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
태그 태그 추가

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.2

See release notes for this release on GitHub: https://github.com/lukaspirpamer/simple_JsonDecode/releases/tag/v1.2

1.1

See release notes for this release on GitHub: https://github.com/lukaspirpamer/simple_JsonDecode/releases/tag/v1.1

1.0.1

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.