===============================================================================
= JSONLab =
= An open-source MATLAB/Octave JSON encoder and decoder =
===============================================================================
*Copyright (C) 2011-2015 Qianqian Fang <fangq at nmr.mgh.harvard.edu>
*License: BSD License, see License_BSD.txt for details
*Version: 1.0 (Optimus - Final)
-------------------------------------------------------------------------------
Table of Content:
I. Introduction
II. Installation
III.Using JSONLab
IV. Known Issues and TODOs
V. Contribution and feedback
-------------------------------------------------------------------------------
I. Introduction
JSON ([http://www.json.org/ JavaScript Object Notation]) is a highly portable,
human-readable and "[http://en.wikipedia.org/wiki/JSON fat-free]" text format
to represent complex and hierarchical data. It is as powerful as
[http://en.wikipedia.org/wiki/XML XML], but less verbose. JSON format is widely
used for data-exchange in applications, and is essential for the wild success
of [http://en.wikipedia.org/wiki/Ajax_(programming) Ajax] and
[http://en.wikipedia.org/wiki/Web_2.0 Web2.0].
UBJSON (Universal Binary JSON) is a binary JSON format, specifically
optimized for compact file size and better performance while keeping
the semantics as simple as the text-based JSON format. Using the UBJSON
format allows to wrap complex binary data in a flexible and extensible
structure, making it possible to process complex and large dataset
without accuracy loss due to text conversions.
We envision that both JSON and its binary version will serve as part of
the mainstream data-exchange formats for scientific research in the future.
It will provide the flexibility and generality achieved by other popular
general-purpose file specifications, such as
[http://www.hdfgroup.org/HDF5/whatishdf5.html HDF5], with significantly
reduced complexity and enhanced performance.
JSONLab is a free and open-source implementation of a JSON/UBJSON encoder
and a decoder in the native MATLAB language. It can be used to convert a MATLAB
data structure (array, struct, cell, struct array and cell array) into
JSON/UBJSON formatted strings, or to decode a JSON/UBJSON file into MATLAB
data structure. JSONLab supports both MATLAB and
[http://www.gnu.org/software/octave/ GNU Octave] (a free MATLAB clone).
-------------------------------------------------------------------------------
II. Installation
The installation of JSONLab is no different than any other simple
MATLAB toolbox. You only need to download/unzip the JSONLab package
to a folder, and add the folder's path to MATLAB/Octave's path list
by using the following command:
addpath('/path/to/jsonlab');
If you want to add this path permanently, you need to type "pathtool",
browse to the jsonlab root folder and add to the list, then click "Save".
Then, run "rehash" in MATLAB, and type "which loadjson", if you see an
output, that means JSONLab is installed for MATLAB/Octave.
-------------------------------------------------------------------------------
III.Using JSONLab
JSONLab provides two functions, loadjson.m -- a MATLAB->JSON decoder,
and savejson.m -- a MATLAB->JSON encoder, for the text-based JSON, and
two equivallent functions -- loadubjson and saveubjson for the binary
JSON. The detailed help info for the four functions can be found below:
=== loadjson.m ===
<pre>
data=loadjson(fname,opt)
or
data=loadjson(fname,'param1',value1,'param2',value2,...)
parse a JSON (JavaScript Object Notation) file or string
authors:Qianqian Fang (fangq<at> nmr.mgh.harvard.edu)
created on 2011/09/09, including previous works from
Nedialko Krouchev: http://www.mathworks.com/matlabcentral/fileexchange/25713
created on 2009/11/02
Fran�ois Glineur: http://www.mathworks.com/matlabcentral/fileexchange/23393
created on 2009/03/22
Joel Feenstra:
http://www.mathworks.com/matlabcentral/fileexchange/20565
created on 2008/07/03
$Id: loadjson.m 452 2014-11-22 16:43:33Z fangq $
input:
fname: input file name, if fname contains "{}" or "[]", fname
will be interpreted as a JSON string
opt: a struct to store parsing options, opt can be replaced by
a list of ('param',value) pairs - the param string is equivallent
to a field in opt. opt can have the following
fields (first in [.|.] is the default)
opt.SimplifyCell [0|1]: if set to 1, loadjson will call cell2mat
for each element of the JSON data, and group
arrays based on the cell2mat rules.
opt.FastArrayParser [1|0 or integer]: if set to 1, use a
speed-optimized array parser when loading an
array object. The fast array parser may
collapse block arrays into a single large
array similar to rules defined in cell2mat; 0 to
use a legacy parser; if set to a larger-than-1
value, this option will specify the minimum
dimension to enable the fast array parser. For
example, if the input is a 3D array, setting
FastArrayParser to 1 will return a 3D array;
setting to 2 will return a cell array of 2D
arrays; setting to 3 will return to a 2D cell
array of 1D vectors; setting to 4 will return a
3D cell array.
opt.ShowProgress [0|1]: if set to 1, loadjson displays a progress bar.
output:
dat: a cell array, where {...} blocks are converted into cell arrays,
and [...] are converted to arrays
examples:
dat=loadjson('{"obj":{"string":"value","array":[1,2,3]}}')
dat=loadjson(['examples' filesep 'example1.json'])
dat=loadjson(['examples' filesep 'example1.json'],'SimplifyCell',1)
</pre>
=== savejson.m ===
<pre>
json=savejson(rootname,obj,filename)
or
json=savejson(rootname,obj,opt)
json=savejson(rootname,obj,'param1',value1,'param2',value2,...)
convert a MATLAB object (cell, struct or array) into a JSON (JavaScript
Object Notation) string
author: Qianqian Fang (fangq<at> nmr.mgh.harvard.edu)
created on 2011/09/09
$Id: savejson.m 458 2014-12-19 22:17:17Z fangq $
input:
rootname: the name of the root-object, when set to '', the root name
is ignored, however, when opt.ForceRootName is set to 1 (see below),
the MATLAB variable name will be used as the root name.
obj: a MATLAB object (array, cell, cell array, struct, struct array).
filename: a string for the file name to save the output JSON data.
opt: a struct for additional options, ignore to use default values.
opt can have the following fields (first in [.|.] is the default)
opt.FileName [''|string]: a file name to save the output JSON data
opt.FloatFormat ['%.10g'|string]: format to show each numeric element
of a 1D/2D array;
opt.ArrayIndent [1|0]: if 1, output explicit data array with
precedent indentation; if 0, no indentation
opt.ArrayToStruct[0|1]: when set to 0, savejson outputs 1D/2D
array in JSON array format; if sets to 1, an
array will be shown as a struct with fields
"_ArrayType_", "_ArraySize_" and "_ArrayData_"; for
sparse arrays, the non-zero elements will be
saved to _ArrayData_ field in triplet-format i.e.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【项目简介】 matlab吴恩达机器学习 卓金武《MATLAB在数学建模中的应用》 第2版 国赛官方的评阅要点 图论算法及其MATLAB实现 matlab图论 数字语音处理及MATLAB仿真 matlab语音信号处理与仿真 数学建模30个常用算法(Python代码) 数学建模比赛常用的代码 数学建模算法与应用 最优化问题相关算法 现代算法 美赛A题常见代码 美赛B题常见代码 美赛C题常见代码 美赛D题常见参考代码 美赛E题常见参考代码 美赛F题常见参考代码 word基础和配套练习.docx K-近邻法分类代码.zip MATLAB优化算法 张岩.zip MATLAB神经网络30个案例分析.zip
资源推荐
资源详情
资源评论
收起资源包目录
数维杯Mathematical-modeling.zip (1117个子文件)
wavenn.asv 3KB
chapter8.2.asv 3KB
LPINT.asv 2KB
LPINT.asv 2KB
Untitled2.asv 1KB
chapter2_2.asv 853B
Ik_com.asv 740B
KRUSK.C 2KB
粒子群算法的基本理论及其改进研究_刘建华.caj 6.13MB
基于优化粒子群算法的物流配送路径问题研究_李莹莹.caj 5.51MB
粒子群算法的研究及应用_刘衍民.caj 3.92MB
粒子群算法在最优化问题中的研究_梁军.caj 680KB
神经网络入门教程.CHM 129KB
input_assgin02_01(1).dat 29B
input_assgin02_01.dat 29B
input_assgin02_04(1).dat 28B
input_assgin02_04.dat 28B
input_assgin02_05(1).dat 24B
input_assgin02_05.dat 24B
input_assgin02_02.dat 23B
input_assgin02_02(1).dat 23B
input_assgin02_03.dat 18B
input_assgin02_03(1).dat 18B
KRUSK.DLL 40KB
用蒙特卡洛法实现对排队等待问题的计算机模拟.doc 360KB
主成份分析.doc 352KB
matlab多元非线性回归教程.doc 333KB
matlab多元非线性回归教程.doc 333KB
粒子群算法matlab代码.doc 327KB
元胞自动机.doc 304KB
2009高教社杯全国大学生数学建模竞赛A-B-C-D题评阅要点.doc 155KB
随机模拟与系统仿真.doc 109KB
随机模拟与系统仿真.doc 109KB
传染病模型SI、SIS、SIR.doc 88KB
2007高教社杯全国大学生数学建模竞赛B题评阅要点.doc 73KB
幻灯用材料.doc 64KB
2016年全国大学生数学建模B题官方答案提示.doc 49KB
2015高教社杯全国大学生数学建模竞赛A题评阅要点.doc 49KB
蒙特卡罗模拟.doc 47KB
蒙特卡罗算法举例.doc 40KB
2006高教社杯全国大学生数学建模竞赛A、B题评阅要点.doc 39KB
linxl.doc 39KB
2006高教社杯全国大学生数学建模竞赛题评阅要点.doc 38KB
用Matlab求解下列各初值问题.doc 37KB
2011高教社杯全国大学生数学建模竞赛ABCD4题评阅要点.doc 36KB
2014高教社杯全国大学生数学建模竞赛C题评阅要点.doc 34KB
2016年全国大学生数学建模A题评阅要点.doc 32KB
2004高教社杯全国大学生数学建模竞赛A题评阅要点.doc 31KB
2012高教社杯全国大学生数学建模竞赛C题评阅要点.doc 27KB
2013年全国大学生数学建模竞赛A题-B题评卷要点.doc 25KB
多目标模糊综合评价模型Python代码(1).docx 1.26MB
多目标模糊综合评价模型Python代码.docx 1.26MB
1.word基础和配套练习.docx 1.03MB
基于遗传算法修正的BP神经网络算法.docx 851KB
改进灰色马尔科夫模型湖北省用水量预测模型.docx 256KB
2010高教社杯全国大学生数学建模竞赛C题评阅要点.docx 125KB
二次规划模型Python代码.docx 113KB
二次规划模型Python代码(1).docx 113KB
整数规划模型Python代码.docx 59KB
整数规划模型Python代码(1).docx 59KB
非线性规划模型Python代码(1).docx 40KB
非线性规划模型Python代码.docx 40KB
TOPSIS综合评价模型Python代码(1).docx 28KB
TOPSIS综合评价模型Python代码.docx 28KB
多项式逻辑回归.docx 21KB
K-means聚类模型Python代码.docx 16KB
K-means聚类模型Python代码(1).docx 16KB
2014-高教社杯全国大学生数学建模竞赛AB题评阅要点.docx 16KB
蒙特卡洛模型Python代码(1).docx 14KB
蒙特卡洛模型Python代码.docx 14KB
最短路径算法Python代码(1).docx 13KB
最短路径算法Python代码.docx 13KB
离散型遗传算法求解组合优化代码.docx 13KB
sklearn神经网络—多分类数字识别(1).docx 13KB
sklearn神经网络—多分类数字识别.docx 13KB
PCA.fig 18KB
si(1).fig 14KB
figure.fig 9KB
figure.fig 9KB
figure.fig 9KB
centre.fig 8KB
centre.fig 8KB
centre.fig 8KB
sir(3).fig 7KB
sis(3).fig 3KB
sis(1).fig 3KB
si(2).fig 2KB
sir(1).fig 2KB
sis(4).fig 2KB
sir(2).fig 2KB
sis(2).fig 2KB
berlin52.tsp.gz 472B
chapter14.html 26KB
chapter12.html 15KB
test.in 53B
LICENSE 1KB
三根鸡毛信_蒙特卡罗编程.pdf.lnk 670B
GATBXA1.LOG 458B
GATBXA2.LOG 273B
GATBXA0.LOG 273B
共 1117 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
想念@思恋
- 粉丝: 709
- 资源: 100
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 驱动代码驱动代码驱动代码驱动代码
- SVID_20240523_141155_1.mp4
- Code for the complete guide to tkinter tutorial
- 关于百货中心供应链管理系统.zip
- SimpleFolderIcon-master 修改Unity的Project下的文件夹图标
- A python Tkinter widget to display tile based maps
- A pure Python library for adding tables to a Tkinter application
- Vector资源文件.zip
- MobaXterm-Installer
- 88-520告白(520气球).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功