Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

I have 2 set of numbers A & B with elements 1-10, I want to determine an expression which requires different values of A & B such like, when A>=6 and B<=3 but my if statement giving the error || and && must be convertible to logical scalar

1 visualizzazione (ultimi 30 giorni)
I have 2 set of numbers A & B with elements 1-10, I want to determine an expression which requires different values of A & B such like, when A>=6 and B<=3 but my if statement giving the error || and && must be convertible to logical scalar
  1 Commento
Stephen23
Stephen23 il 29 Giu 2015
Modificato: Stephen23 il 29 Giu 2015
MATLAB has different logical operators, which are useful in different situations. The short-circuit operators && and || are used only with scalar values. If the values are not scalar, then you must use the normal logical operators & and |.

Risposte (1)

Walter Roberson
Walter Roberson il 29 Giu 2015
Don't use && and || then. Use & and |

Questa domanda è chiusa.

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by