Code now produces json output from the matlab output.