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.
假设我们有一个维度为 的矩阵10x2。如何1仅在 中找到列的行的最大值matlab?
10x2
1
matlab
谢谢。
A = rand(10,2); % 10x2 matrix max(A(:,1)); % max for column 1 of A
A = rand(10,2); %10x2 matrix Amax = max(A,[],1); %max across rows Amax(1) %max of the 1st col
从某种意义上说,这是一种更通用的方法,它首先计算所有行的最大值,这对于访问多个最大元素很有用。