aybike nurocak <
dilem...@gmail.com> writes:
> [y,v] = max(a) returns the indices of the maximum values in vector v
> on Matlab. How can I do this on Maple 13 ?
>
> a=[1 2+i]
>
> a =
>
> 1.0000 2.0000 + 1.0000i
>
>>> [c,d]=max(real(a))
>
> c =
>
> 2
>
>
> d =
>
> 2
You can use rtable_scanblock for this
V := <1,2,4,3>:
rtable_scanblock(V
, [rtable_dims(V)]
, (val,ind,res) -> `if`(val>res[2]
,[ind,val]
,res
)
, [ [1,1], V[1] ]
);
[[3], 4]
However, a simpler method is to use member
member(max(V),V,'pos');
true
pos;
3
--
Joe Riel