Is there any instruction can ignore the "0" value and find the minimum value of a matrix ?

2 次查看(过去 30 天)
Is there any instruction can ignore the "0" value and find the minimum value of a matrix ? I mean ,if i assume
A=[0 1 2 3]
How do i write the code to let the minimum value is 1 instead of 0

采纳的回答

KSSV
KSSV 2019-4-2
编辑:KSSV 2019-4-2
A=[0 1 2 3]
[val,idx] = sort(A) ;
iwant = val(2)
A(A==0) = NaN
min(A)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Argument Definitions 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by