Quick way to change complex number into NaN

28 次查看(过去 30 天)
If I have a matrix of A=[1 2 ; 2+i 3] I want to make it into A=[1 2; NaN 3] Is there anyway like using isnan function to do this? Thanx!

采纳的回答

Teja Muppirala
Teja Muppirala 2012-11-13
A(imag(A)~=0) = nan;

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by