samer@4: function [I,Y]=argmin1(D,X) samer@4: % argmin1 - return index of minimum along a particular dimension samer@4: % samer@4: % argmin1 :: samer@4: % D:1..E ~'dimension over which to argmax', samer@4: % [S:[[E]->natural]->real] ~ samer@4: % 'array of size S where S is an array of E naturals. samer@4: % The array must be real so linear ordering is defined' samer@4: % -> [T:[[E]->natural]->1..S(D)] ~ samer@4: % 'array of indices of maxima, of size T, where T is like samer@4: % 'S except that T(D)=1. Indices are in the range 1..S(D)', samer@4: % [T:[[E]->natural]->real] ~'the actual minimum values'. samer@4: samer@4: [Y,I]=min(X,[],D); samer@4: