Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

如何找出A向量中最大值所在的位置,然后返回B向量中该位置对应的值

我现在有A、B两个向量,长度相等,我想找出A向量中最大值所在的位置,然后返回B向量中该位置对应的值,DolphinDB中给有没有写好的函数可以实现上述功能?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

DolphinDB中的atImax函数可以实现上述的功能,示例代码如下:

a = 1 2 3 4 5 6
b = 7 8 9 10 11 12
atImax(a, b)

返回:
12


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...