help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Index expressions: .* vs &


From: Mike B.
Subject: Index expressions: .* vs &
Date: Thu, 5 Aug 2010 22:55:13 -0700 (PDT)

Hi All,

Can someone please explain the following behaviour:

a = [1; 2 ];
z1 = (a > 0)&(a>1);
z2( z1 ) = 1

gives z2 = [ 0, 1 ] (as expected).

Now, 
z1 = (a > 0).*(a>1);
z2( z1 ) = 1

gives
> error: subscript indices must be either positive integers or logicals.

why the difference between & and .* when used for index expressions?

Thanks,
Mike.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]