>> a=[1,6,3;7,5,6] a = 1 6 3 7 5 6 >> [q,p]=max(a,[],2) 返回每行最大值,q是结果、p是索引 q = 6 7 p = 2 1 >> [q,p]=max(a,[],1) 返回每列最大值,q是结果、p是索引
q =
7 6 6
p =
2 1 2
原文地址:https://www.cnblogs.com/znsongshu/p/9276902.html
时间: 2024-10-24 16:41:01
>> a=[1,6,3;7,5,6] a = 1 6 3 7 5 6 >> [q,p]=max(a,[],2) 返回每行最大值,q是结果、p是索引 q = 6 7 p = 2 1 >> [q,p]=max(a,[],1) 返回每列最大值,q是结果、p是索引
q =
7 6 6
p =
2 1 2
原文地址:https://www.cnblogs.com/znsongshu/p/9276902.html