===============================================================================
= 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编程作业,线性回归,逻辑回归,前向神经网络,BP神经网络,优秀matlab源代码,新手必看! 吴恩达机器学习matlab编程作业,线性回归,逻辑回归,前向神经网络,BP神经网络,优秀matlab源代码,新手必看! 吴恩达机器学习matlab编程作业,线性回归,逻辑回归,前向神经网络,BP神经网络,优秀matlab源代码,新手必看! 吴恩达机器学习matlab编程作业,线性回归,逻辑回归,前向神经网络,BP神经网络,优秀matlab源代码,新手必看! 吴恩达机器学习matlab编程作业,线性回归,逻辑回归,前向神经网络,BP神经网络,优秀matlab源代码,新手必看!
资源推荐
资源详情
资源评论
收起资源包目录
吴恩达机器学习matlab编程作业,线性回归,逻辑回归,前向神经网络,BP神经网络,优秀matlab源代码,新手必看! (108个子文件)
.gitattributes 66B
loadjson.m 18KB
loadjson.m 18KB
loadjson.m 18KB
loadjson.m 18KB
savejson.m 17KB
savejson.m 17KB
savejson.m 17KB
savejson.m 17KB
saveubjson.m 16KB
saveubjson.m 16KB
saveubjson.m 16KB
saveubjson.m 16KB
loadubjson.m 15KB
loadubjson.m 15KB
loadubjson.m 15KB
loadubjson.m 15KB
fmincg.m 9KB
fmincg.m 9KB
ex4.m 8KB
submitWithConfiguration.m 5KB
submitWithConfiguration.m 5KB
submitWithConfiguration.m 5KB
submitWithConfiguration.m 5KB
ex1_multi.m 4KB
ex2.m 4KB
nnCostFunction.m 4KB
ex1.m 4KB
ex2_reg.m 4KB
ex3_nn.m 3KB
ex3.m 3KB
oneVsAll.m 2KB
checkNNGradients.m 2KB
submit.m 2KB
lrCostFunction.m 2KB
predictOneVsAll.m 2KB
submit.m 2KB
submit.m 2KB
featureNormalize.m 2KB
submit.m 2KB
displayData.m 1KB
displayData.m 1KB
plotDecisionBoundary.m 1KB
costFunctionReg.m 1KB
makeValidFieldName.m 1KB
makeValidFieldName.m 1KB
makeValidFieldName.m 1KB
makeValidFieldName.m 1KB
predict.m 1KB
computeNumericalGradient.m 1KB
varargin2struct.m 1KB
varargin2struct.m 1KB
varargin2struct.m 1KB
varargin2struct.m 1KB
plotData.m 1KB
gradientDescentMulti.m 1KB
gradientDescent.m 1KB
costFunction.m 1KB
randInitializeWeights.m 983B
jsonopt.m 881B
jsonopt.m 881B
jsonopt.m 881B
jsonopt.m 881B
plotData.m 870B
computeCostMulti.m 858B
debugInitializeWeights.m 841B
mergestruct.m 771B
mergestruct.m 771B
mergestruct.m 771B
mergestruct.m 771B
predict.m 759B
sigmoidGradient.m 708B
computeCost.m 691B
normalEqn.m 669B
predict.m 585B
warmUpExercise.m 520B
mapFeature.m 508B
sigmoid.m 446B
sigmoid.m 137B
sigmoid.m 137B
ex4data1.mat 7.16MB
ex3data1.mat 7.16MB
ex4weights.mat 78KB
ex3weights.mat 78KB
token.mat 258B
token.mat 258B
token.mat 258B
token.mat 258B
README.txt 19KB
README.txt 19KB
README.txt 19KB
README.txt 19KB
ChangeLog.txt 4KB
ChangeLog.txt 4KB
ChangeLog.txt 4KB
ChangeLog.txt 4KB
ex2data1.txt 4KB
ex2data2.txt 2KB
AUTHORS.txt 2KB
AUTHORS.txt 2KB
共 108 条
- 1
- 2
资源评论
- wolfwolf9532024-12-16发现一个宝藏资源,赶紧冲冲冲!支持大佬~
振华OPPO
- 粉丝: 40w+
- 资源: 570
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功