a =
1 NaN 2 3
>> a(isnan(a)) = 123
a =
1 123 2 3
>> a = [1 inf 2 3]
a =
1 Inf 2 3
>> a(a == inf) = 123
a =
1 123 2 3
a =
1 NaN 2 3
>> a(isnan(a)) = 123
a =
1 123 2 3
>> a = [1 inf 2 3]
a =
1 Inf 2 3
>> a(a == inf) = 123
a =
1 123 2 3
转载于:https://www.cnblogs.com/helloweworld/p/3507920.html