Skip to content

Commit

Permalink
only simplify all-numeric or all-struct cells
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Feb 24, 2023
1 parent d4e77e1 commit 2412ebf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions loadjson.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% matlab data structure with optional memory-map (mmap) table
%
% authors:Qianqian Fang (q.fang <at> neu.edu)
% created on 2011/09/09, including previous works from
% created on 2011/09/09, including previous works from
%
% Nedialko Krouchev: http://www.mathworks.com/matlabcentral/fileexchange/25713
% created on 2009/11/02
Expand Down Expand Up @@ -387,8 +387,8 @@
end

if(varargin{1}.simplifycell)
if(iscell(object) && ~isempty(object) && (isnumeric(object{1}) || isstruct(object{1})) )
if(all(cellfun(@(e) isequal(size(object{1}), size(e)) , object(2:end))))
if(iscell(object) && ~isempty(object) && (all(cellfun(@isnumeric, object)) || all(cellfun(@isstruct, object))))
if(all(cellfun(@(e) isequal(size(object{1}), size(e)), object(2:end))))
try
oldobj=object;
if(iscell(object) && length(object)>1 && ndims(object{1})>=2)
Expand Down

0 comments on commit 2412ebf

Please sign in to comment.