need explanation

Discussion in 'Programmer's Corner' started by Judas543, May 4, 2010.

  1. Judas543

    Thread Starter Member

    Jan 26, 2010
    60
    0
    A = 4;

    C = [3 6 9 12];

    D = [2 4 8 16];

    A > 2 && C > D


    How come i get an error?
     
  2. blah2222

    Well-Known Member

    May 3, 2010
    554
    33
    Could you be more specific with your question?
     
  3. Ghar

    Active Member

    Mar 8, 2010
    655
    72
    I think the problem is that && is a logical AND while C > D will return a matrix.
    Try using & for bitwise AND.
    Not sure what result you'll get though...
     
Loading...