Skip to content

Commit b89275e

Browse files
committed
update help info, skip empty arrays
1 parent 9d0fd4a commit b89275e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

jdataencode.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
function jdata=jdencode(data, varargin)
1+
function jdata=jdataencode(data, varargin)
22
%
3-
% jdata=jdencode(data)
3+
% jdata=jdataencode(data)
44
% or
5-
% jdata=jdencode(data, options)
6-
% jdata=jdencode(data, 'Param1',value1, 'Param2',value2,...)
5+
% jdata=jdataencode(data, options)
6+
% jdata=jdataencode(data, 'Param1',value1, 'Param2',value2,...)
77
%
88
% Serialize a MATLAB struct or cell array into a JData-compliant
99
% structure as defined in the JData spec: http://github.com/fangq/jdata
@@ -19,7 +19,7 @@
1919
% total element count is larger than this number.
2020
%
2121
% example:
22-
% jd=jdencode(struct('a',rand(5)+1i*rand(5),'b',[],'c',sparse(5,5)))
22+
% jd=jdataencode(struct('a',rand(5)+1i*rand(5),'b',[],'c',sparse(5,5)))
2323
%
2424
% license:
2525
% BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
@@ -29,7 +29,7 @@
2929

3030

3131
if(nargin==0)
32-
help jdencode
32+
help jdataencode
3333
return;
3434
end
3535

@@ -95,7 +95,7 @@
9595

9696
%%-------------------------------------------------------------------------
9797
function newitem=mat2jd(item,varargin)
98-
if(isa(item,'string') || ischar(item) || (isvector(item) && isreal(item) && ~issparse(item)))
98+
if(isempty(item) || isa(item,'string') || ischar(item) || (isvector(item) && isreal(item) && ~issparse(item)))
9999
newitem=item;
100100
return;
101101
end

0 commit comments

Comments
 (0)