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 で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!