Skip to content

Commit c17bbe7

Browse files
committed
Examples: fix bugs in primer
1 parent 4ad2cb9 commit c17bbe7

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

examples/Primer.m

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
clear all;
77

88
%% File operations
9-
path = 'module2.h5';
9+
path = 'tests/test.h5';
1010

1111
% Open NIX file
1212
f = nix.File(path, nix.FileMode.ReadOnly);
@@ -40,9 +40,7 @@
4040
% get DataArrays by several criteria
4141
cond1 = @(x) ~isempty(strfind(x.name, 'SpikeActivity'));
4242
cond2 = @(x) any(cellfun(@(y) strcmp(y.name, 'Unit 7'), x.sources));
43-
cond3 = @(x) x.open_metadata.properties_map('Target') == 2;
44-
cond4 = @(x) x.open_metadata.properties_map('BehavioralCondition') == 3;
45-
idx = cellfun(@(x) cond1(x) & cond2(x) & cond3(x) & cond4(x), b.dataArrays);
43+
idx = cellfun(@(x) cond1(x) & cond2(x), b.dataArrays);
4644
selection2 = b.dataArrays(idx);
4745

4846
% get actual data
@@ -51,7 +49,7 @@
5149

5250
% understand dimensions
5351
dim1 = d1.dimensions{1};
54-
dim1.type
52+
dim1.dimensionType
5553
dim1.unit
5654

5755
% plot data
@@ -67,13 +65,11 @@
6765
sec = f.sections{2}.sections{1};
6866

6967
% display all Section properties
70-
cellfun(@(x) disp(x), sec.properties_cell);
68+
cellfun(@(x) disp(x), sec.allProperties);
7169

7270
% get a certain Value by index
73-
value = sec.properties_cell{1}.values{1};
71+
value = sec.allProperties{1}.values{1};
7472

7573
% or by name
76-
value = sec.properties_map('Name');
74+
value = sec.open_property('Name').values{1}.value;
7775

78-
%% clear space
79-
clear all;

0 commit comments

Comments
 (0)