In working with the fftfilt() routine and wanting to know if the inputs
were purely imaginary I wondered why there is no such thing as isimag().
It seems as though it would be as useful as or more useful than
iscomplex().
Here's the thing: iscomplex() appears to be simply the complement of
isreal(), unless I'm missing a more sophisticated use of syntax:
octave:5> x = 1
x = 1
octave:6> [isreal(x) iscomplex(x)]
ans =
1 0
octave:7> x = i
x = 0 + 1i
octave:8> [isreal(x) iscomplex(x)]
ans =
0 1
octave:9> x = 1+i
x = 1 + 1i
octave:10> [isreal(x) iscomplex(x)]
ans =
0 1
octave:11>
I ask, What's the point of having a function that is simply !isreal()?
On the other hand isimag(), which is equivalent to "all (real (x) == 0))
&& !isreal (x)", would be a nice shorthand.
Just an observation. Usually duplication of function (or its
complement) is weeded out of programming languages.
Dan
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev