Skip to content

Commit e198d04

Browse files
committed
unfold: use channel names for colnames if they exist
1 parent 3c52615 commit e198d04

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/@Image/unfold.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@
3636
nc = channelNumber(obj);
3737

3838
% create column names array
39-
colNames = cell(1, nc);
40-
for i = 1:nc
41-
colNames{i} = sprintf('Ch%02d', i);
39+
colNames = obj.ChannelNames;
40+
if isempty(obj.ChannelNames) || length(obj.ChannelNames) ~= nc
41+
warning('ChannelNames property was not correctly initialized');
42+
colNames = cell(1, nc);
43+
for i = 1:nc
44+
colNames{i} = sprintf('Ch%02d', i);
45+
end
4246
end
4347

4448
% create data table

0 commit comments

Comments
 (0)