Skip to content

Commit

Permalink
Update getRow.m
Browse files Browse the repository at this point in the history
Update function to also transpose 2D arrays (matrices) which are not vectors
  • Loading branch information
ehennestad committed Dec 12, 2024
1 parent bed7e73 commit dff5ca6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions +types/+util/+dynamictable/getRow.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@
row{i} = select(DynamicTable, indexNames, ind);

if ~istable(row{i})
% transpose row vectors
if isrow(row{i})
row{i} = row{i} .';
% or permute arrays to place last dimension first
elseif ~ismatrix(row{i}) % i.e nd array where n >= 3
if iscolumn(row{i})
% keep column vectors as is
elseif isrow(row{i})
row{i} = row{i} .'; % transpose row vectors
elseif ndims(row{i}) >= 2 % i.e nd array where ndims >= 2
% permute arrays to place last dimension first
array_size = size(row{i});
num_rows = numel(ind);

Expand Down

0 comments on commit dff5ca6

Please sign in to comment.