Mercurial > hg > ishara
annotate general/numerical/array/argmax1.m @ 35:f1ce7876346a
Updated docs.
author | samer |
---|---|
date | Mon, 21 Jan 2013 11:01:45 +0000 |
parents | db7f4afd27c5 |
children |
rev | line source |
---|---|
samer@4 | 1 function [I,Y]=argmax1(D,X) |
samer@4 | 2 % argmax1 - return indices of maxima along a particular dimension |
samer@4 | 3 % |
samer@4 | 4 % argmax1 :: |
samer@4 | 5 % D:1..E ~'dimension over which to argmax', |
samer@4 | 6 % [S:[[E]->natural]->real] ~ |
samer@4 | 7 % 'array of size S where S is an array of E naturals. |
samer@4 | 8 % The array must be real so linear ordering is defined' |
samer@4 | 9 % -> [T:[[E]->natural]->1..S(D)] ~ |
samer@4 | 10 % 'array of indices of maxima, of size T, where T is like |
samer@4 | 11 % 'S except that T(D)=1. Indices are in the range 1..S(D)', |
samer@4 | 12 % [T:[[E]->natural]->real] ~'the actual maximum values'. |
samer@4 | 13 |
samer@4 | 14 [Y,I]=max(X,[],D); |
samer@4 | 15 |