Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想获取二维数组中特定行的索引。我有一个 15*15 数组(Q),我想获取第二行的最大数量的索引。我写了这段代码,但是发生了错误:
y=Q(2,:); x=max(y) ??? Subscript indices must either be real positive integers or logicals.
您正在获得第二行的最大值,但您想要最大值的索引。以下是获取索引的方法:
[~, index] = max(y)