diff general/numerical/argmin1.m @ 4:e44f49929e56

Adding reorganised general toolbox, now in several subdirectories.
author samer
date Sat, 12 Jan 2013 19:21:22 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/general/numerical/argmin1.m	Sat Jan 12 19:21:22 2013 +0000
@@ -0,0 +1,15 @@
+function [I,Y]=argmin1(D,X)
+% argmin1 - return index of minimum along a particular dimension
+%
+% argmin1 :: 
+%    D:1..E   ~'dimension over which to argmax',
+%    [S:[[E]->natural]->real] ~
+%			'array of size S where S is an array of E naturals.
+%         The array must be real so linear ordering is defined'
+% -> [T:[[E]->natural]->1..S(D)] ~
+%        'array of indices of maxima, of size T, where T is like
+%        'S except that T(D)=1. Indices are in the range 1..S(D)',
+%    [T:[[E]->natural]->real] ~'the actual minimum values'.
+
+[Y,I]=min(X,[],D);
+