Skip to content

Commit

Permalink
jdatadecode now handles _ArrayOrder_
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Jun 5, 2020
1 parent 89b844c commit 3119ce4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions jdatadecode.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@
if(isfield(data,N_('_ArrayIsComplex_')) && data(j).(N_('_ArrayIsComplex_')) )
iscpx=1;
end
iscol=0;
if(isfield(data,N_('_ArrayOrder_')))
arrayorder=data(j).(N_('_ArrayOrder_'));
if(~isempty(arrayorder) && (arrayorder(1)=='c' || arrayorder(1)=='C'))
iscol=1;
end
end
if(isfield(data,N_('_ArrayIsSparse_')) && data(j).(N_('_ArrayIsSparse_')))
if(isfield(data,N_('_ArraySize_')))
dim=data(j).(N_('_ArraySize_'))(:)';
Expand Down Expand Up @@ -278,7 +285,7 @@
if(iscpx)
ndata=complex(ndata(1,:),ndata(2,:));
end
if(format>1.9)
if(format>1.9 && iscol==0)
data(j).(N_('_ArraySize_'))=data(j).(N_('_ArraySize_'))(end:-1:1);
end
dims=data(j).(N_('_ArraySize_'))(:)';
Expand All @@ -289,7 +296,7 @@
dims=[1 dims];
end
ndata=reshape(ndata(:),dims(:)');
if(format>1.9)
if(format>1.9 && iscol==0)
ndata=permute(ndata,ndims(ndata):-1:1);
end
end
Expand Down

0 comments on commit 3119ce4

Please sign in to comment.