forked from NeuroJSON/jsonlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjdataencode.m
More file actions
28 lines (27 loc) · 924 Bytes
/
jdataencode.m
File metadata and controls
28 lines (27 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function newdata=jdataencode(data,varargin)
%
% newdata=jdataencode(data,opt,...)
%
% encode special MATLAB objects (cells, structs, sparse and complex arrays,
% maps, graphs, function handles, etc) to the JData format
%
% authors:Qianqian Fang (q.fang <at> neu.edu)
%
% input:
% data: a matlab object
% opt: (optional) a list of 'Param',value pairs for additional options.
% For all supported options, please see the help info for savejson.m
% and loadjson.m
%
% output:
% newdata: the covnerted data containing JData structures
%
% examples:
% jd=jdataencode(struct('a',rand(5)+1i*rand(5),'b',[],'c',sparse(5,5)))
%
% license:
% BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
%
% -- this function is part of JSONLab toolbox (http://iso2mesh.sf.net/cgi-bin/index.cgi?jsonlab)
%
newdata=loadjson(savejson('',data,varargin{:}),varargin{:},'JDataDecode',0);