Mercurial > hg > ishara
view general/numerical/array/proddims.m @ 16:db7f4afd27c5
Rearranging numerical toolbox.
author | samer |
---|---|
date | Thu, 17 Jan 2013 13:20:44 +0000 |
parents | general/numerical/proddims.m@e44f49929e56 |
children |
line wrap: on
line source
function A=proddims(A,dims) % proddims - Product over multiple dimensions % % proddims :: % [Size:[[1,E]]->A] ~'E dimensional array', % Dims:[[K]->1..E] ~'dims to prod over' % -> [Size1->A] :- Size1=arrset(Size,Dims,1). % % Result is same size as input except for summed dimensions % which are collapsed to a size of 1. for i=dims, A=prod(A,i); end