comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirstruct/subsref.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function b = subsref(a,index)
2 % Define field name indexing for mirstruct objects
3 switch index(1).type
4 case '.'
5 if strcmpi(index(1).subs,'tmp')
6 if length(index)== 1
7 b = [];
8 else
9 if length(index)>2
10 if strcmpi(index(3).type,'{}')
11 isubs = index(3).subs;
12 if length(isubs)>1
13 b = a.tmp.(index(2).subs){isubs{1},isubs{2}};
14 else
15 b = a.tmp.(index(2).subs){isubs{1}};
16 end
17 end
18 else
19 b = a.tmp.(index(2).subs);
20 end
21 end
22 return
23 end
24 [is,id] = ismember(index(1).subs,a.fields);
25 if length(index) == 1
26 b = a.data{id};
27 else
28 b = subsref(a.data{id},index(2:end));
29 end
30 end