- the smallest value that is common to all arrays, or
- the smallest value found within any one (or more) of the arrays?
- or something else?
Info
此问题已关闭。 请重新打开它进行编辑或回答。
Can I scan 10 arrays all together to find one smallest value between all arrays?
1 次查看(过去 30 天)
显示 更早的评论
I have 10 arrays.I need to be able to find the smallest value. I want to find another way of doing this rather than combining all 10 arrays into 1 and then scanning them.
回答(2 个)
Stephen23
2015-4-26
编辑:Stephen23
2015-4-26
Basically you have to choose whether you combine the values or take the minimum first. Each of these has different advantages, so it depends on what you are trying to achieve:
- Combine them into one array Z = [A,B,C,...] and then call min(Z(:)). This is likely to be the fastest and neatest code.
- Combine the minimum of each Y = [min(A(:)),min(B(:)),...] and then min(Y).
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!