gpt4 book ai didi

find - Octave:找到一行中的最小值,也是它的索引

转载 作者:行者123 更新时间:2023-12-02 18:13:51 24 4
gpt4 key购买 nike

如何找到每一行中的最小值以及最小值的索引?

octave:1> a = [1 2 3; 9 8 7; 5 4 6]
a =

1 2 3
9 8 7
5 4 6

最佳答案

这在文档中很难找到。 https://www.gnu.org/software/octave/doc/v4.0.3/Utility-Functions.html

octave:2> [minval, idx] = min(a, [], 2)
minval =

1
7
4

idx =

1
3
2

关于find - Octave:找到一行中的最小值,也是它的索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45608349/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com