wolffd@0: function b = subsref(a,index) wolffd@0: % Define field name indexing for mirstruct objects wolffd@0: switch index(1).type wolffd@0: case '.' wolffd@0: if strcmpi(index(1).subs,'tmp') wolffd@0: if length(index)== 1 wolffd@0: b = []; wolffd@0: else wolffd@0: if length(index)>2 wolffd@0: if strcmpi(index(3).type,'{}') wolffd@0: isubs = index(3).subs; wolffd@0: if length(isubs)>1 wolffd@0: b = a.tmp.(index(2).subs){isubs{1},isubs{2}}; wolffd@0: else wolffd@0: b = a.tmp.(index(2).subs){isubs{1}}; wolffd@0: end wolffd@0: end wolffd@0: else wolffd@0: b = a.tmp.(index(2).subs); wolffd@0: end wolffd@0: end wolffd@0: return wolffd@0: end wolffd@0: [is,id] = ismember(index(1).subs,a.fields); wolffd@0: if length(index) == 1 wolffd@0: b = a.data{id}; wolffd@0: else wolffd@0: b = subsref(a.data{id},index(2:end)); wolffd@0: end wolffd@0: end