annotate general/numerical/array/argmin1.m @ 61:eff6bddf82e3
tip
Finally implemented perceptual brightness thing.
author |
samer |
date |
Sun, 11 Oct 2015 10:20:42 +0100 |
parents |
db7f4afd27c5 |
children |
|
rev |
line source |
samer@4
|
1 function [I,Y]=argmin1(D,X)
|
samer@4
|
2 % argmin1 - return index of minimum along a particular dimension
|
samer@4
|
3 %
|
samer@4
|
4 % argmin1 ::
|
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 minimum values'.
|
samer@4
|
13
|
samer@4
|
14 [Y,I]=min(X,[],D);
|
samer@4
|
15
|