Skip to content

Commit 8848bc7

Browse files
committed
I2MCfunc: make sure all data are column vectors
1 parent 8b4a44a commit 8848bc7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

functions/I2MC/I2MCfunc.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@
110110
%% START ALGORITHM
111111

112112
%% PREPARE INPUT DATA
113+
% make sure all fields in data are columns
114+
fs = fieldnames(data);
115+
for f=1:length(fs)
116+
if isstruct(data.(fs{f}))
117+
fs2 = fieldnames(data.(fs{f}));
118+
for f2=1:length(fs2)
119+
data.(fs{f}).(fs2{f2}) = data.(fs{f}).(fs2{f2})(:);
120+
end
121+
else
122+
data.(fs{f}) = data.(fs{f})(:);
123+
end
124+
end
113125
% deal with monocular data, or create average over two eyes
114126
if isfield(data,'left') && ~isfield(data,'right')
115127
xpos = data.left.X;

0 commit comments

Comments
 (0)