Find max of matrix without using built in function.
显示 更早的评论
I want to find the "max(a)" without actually using the built in "max" function.
2 个评论
Roland
2011-5-4
Sean de Wolski
2011-5-4
We won't do your homework for you. What have you tried so far.
采纳的回答
更多回答(2 个)
Sean de Wolski
2011-5-4
the_max = -min(-(a(:)))
Adrien Leygue
2011-5-4
0 个投票
The following code will extract the minimum over each column. No loop no max no min and of course not optimal. Feel free to adapt it to other purposes:
S = A((repmat(eye(size(A,1)),[1 size(A,1)]) *(kron(A,ones(size(A,1),1)) < kron(ones(size(A,1),1),A)))==0)'
A.
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!