Prev: Please help me produce a nice .eps or .pdf using pcolor
Next: EvaluateFunction error .... fails with no error message
From: Beskie on 22 Apr 2010 13:28 A(logical(isprime(A)==1))
From: Walter Roberson on 22 Apr 2010 14:09
Beskie wrote: > > A(logical(isprime(A)==1)) Ah, in that case you could shorten the code to A(isprime(A)) The result of isprime is already 0 and 1's, which is good enough for logical indexing without needing to compare for 1 (which would produce a logical value for sure) and without needing the logical() call (which would be redundant on logical values.) |