Daniel@0: function Tbig = divide_by_pot(Tbig, Tsmall) Daniel@0: % DIVIDE_BY_POT Tbig /= Tsmall Daniel@0: % Tbig = divide_by_pot(Tbig, Tsmall) Daniel@0: % Daniel@0: % Tsmall's domain must be a subset of Tbig's domain. Daniel@0: Daniel@0: smallp = extend_domain_table(Tsmall.p, Tsmall.domain, Tsmall.sizes, Tbig.domain, Tbig.sizes); Daniel@0: smallp = smallp + (smallp==0); Daniel@0: Tbig.p = Tbig.p ./ smallp; Daniel@0: Daniel@0: smallu = extend_domain_table(Tsmall.u, Tsmall.domain, Tsmall.sizes, Tbig.domain, Tbig.sizes); Daniel@0: Tbig.u = Tbig.u - smallu; Daniel@0: