This will not affect your code.
You are encountering Command/Function Duality https://www.mathworks.com/help/matlab/matlab_prog/command-vs-function-syntax.html
When you call
imag part
that is the same as if you had invoked
imag('part')
which is calling imag() on the vector of four characters, 'p', 'a', 'r', 't' .
In many circumstances, characters automatically convert to the numeric codes used to internally encode the characters, such as 112 for 'p', and 97 for 'a' . So imag() treats this as a vector of real-valued double precision numbers. But the imaginary() portion of those is all 0 so 0 0 0 0 gets returned.