File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 134134
135135 % detect switches and weight of switch (= 1/number of switches in
136136 % portion)
137- [switches ,switchesw ] = deal(cell(1 ,nd + 1 ));
137+ [switches ] = deal(cell(1 ,nd + 1 ));
138+ switchesw = nan(1 ,nd + 1 );
138139 for p= 1 : nd + 1
139140 switches{p } = abs(diff(IDL_d{p }));
140- switchesw{ p } = 1 / sum(switches{p });
141+ switchesw( p ) = 1 / sum(switches{p });
141142 end
142143
143144 % get nearest samples of switch and add weight
144- weighted = [switches{1 }*switchesw{ 1 } ; 0 ];
145+ weighted = [switches{1 }*switchesw( 1 ) ; 0 ];
145146 for p= 1 : nd
146147 j = find(switches{p + 1 })*downsamples(p );
147148 for o= 0 : downsamples(p )-1
148- weighted(j + o ) = weighted(j + o ) + switchesw{ p + 1 } ;
149+ weighted(j + o ) = weighted(j + o ) + switchesw( p + 1 ) ;
149150 end
150151 end
151152
You can’t perform that action at this time.
0 commit comments