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

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
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