Matlab求矩阵最小行
我有大小为 Nx4 的矩阵 A,我想在该矩阵的第 2 列和第 4 列中找到最小对并获取该行的编号,我该怎么做?
例如:
200000 1,23076923076923 20 1,41538461538462
200000 1,23076923076923 200 1,32307692307692
200000 1,23076923076923 2000 1,32307692307692
200000 1,23076923076923 20000 1,29230769230769
200000 1,23076923076923 200000 1,41538461538462
我需要这样的 min(A(:, 2), A(:, 4));
答案将是第四行。
I have matrix A with size Nx4, and I wanna find minimum pair in 2 and 4-th colomns in this matrix and get the number of this row, how can I do this?
for example:
200000 1,23076923076923 20 1,41538461538462
200000 1,23076923076923 200 1,32307692307692
200000 1,23076923076923 2000 1,32307692307692
200000 1,23076923076923 20000 1,29230769230769
200000 1,23076923076923 200000 1,41538461538462
I need something like this min(A(:, 2), A(:, 4));
answer will be 4th row.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
什么是“最小对”?
如果是第二列和第四列都处于最低值的对,则答案为
如果是总和最小的对,则答案为
What is the "minimum pair"?
If it's the pair where both the second and the fourth column are at their lowest, the answer is
If it's the pair with the smallest sum, the answer is