Matlab 2011b
Under certain situations the complex part of my array is zero, but I still need to know that it is a complex array. I still use isreal() to determine if the array is a complex type, but if I copy the array to another array, isreal() returns 1. (see my session below).
Is this a bug?
K>> ar = 1:5;K>> ai = zeros(1, 5); K>> a = complex(ar,ai)a = 1 2 3 4 5K>> isreal(a)ans = 0K>> b = a(1:5);b = 1 2 3 4 5K>> isreal(b)ans = 1
Best Answer