Implemented as a MATLAB class, this file quickly and conveniently turns incoming streams of text into useful data for your MATLAB workspace.
This submission also contains an example/ directory and a test/ directory containing unit tests.
The JSON parser works very nicely, but due to the MathWorks Limited License, this code cannot be used (legally) within any project where the code is to be shared since giving copies of this code to third parties is prohibited. For open-source use this is especially inconvenient.
I think this is a bit unfortunate, since JSON data is widely available and MATLAB doesn't have a built-in parser.
Great submission. Needs two bug fixes - first, need to check fieldname does not start with a digit. Adding "fieldname = regexprep(fieldname,'(^\d)','s$1');" after line 154 of JSON.m will do.
Second, if JSON text has specific numeric values such 91 the code fails because it compares to '[' . Need to replace code pieces like "if value == '['" etc everywhere.
Fixed bugs described by Guy.