Indices for Minimum of an Array
-
Ken-Cogger
- Posts: 13
- Joined: Wed Feb 15, 2012 7:58 pm
Indices for Minimum of an Array
I have an array A(625,625) with minimum value returned by %minvalue(A).
Is there a simple way of returning the indices for this value?
%minindex(A) does not work even though its argument is said to be an array.
Is there a simple way of returning the indices for this value?
%minindex(A) does not work even though its argument is said to be an array.
Re: Indices for Minimum of an Array
You have to vec and unvec it:
compute ix=%maxindex(%vec(a))
compute col=%block(ix,625)
compute row=%clock(ix,625)
compute ix=%maxindex(%vec(a))
compute col=%block(ix,625)
compute row=%clock(ix,625)
-
Ken-Cogger
- Posts: 13
- Joined: Wed Feb 15, 2012 7:58 pm
Re: Indices for Minimum of an Array
What if array A is packed/lower triangular?
Thanks,
Ken.
Thanks,
Ken.
Re: Indices for Minimum of an Array
Use %SYMMCOL and %SYMMROW instead:
compute ix=%maxindex(%vec(a))
compute col=%symmcol(ix)
compute row=%symmrow(ix)
compute ix=%maxindex(%vec(a))
compute col=%symmcol(ix)
compute row=%symmrow(ix)