Asked by Skander Marouani
on 13 Mar 2018

i tiped this condition if m <= 0 && i > 1 and matlab is blocking it and this is the error msg Operands to the and && operators must be convertible to logical scalar values. some one can help me ?

Answer by Greg
on 14 Mar 2018

This means m or i (or both) are not convertible to logical scalar values.

They could be not convertible to logical (is {'Hello World'} true or false?), or they aren't scalar (is [true, false, true, false] true or false?).

Also, your question title is explicitly different from your question. The commands a & b and a && b are drastically different.

Sign in to comment.

Answer by Roger Stafford
on 14 Mar 2018

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 5 Comments

## Skander Marouani (view profile)

Direct link to this comment:https://de.mathworks.com/matlabcentral/answers/388054-if-a-b#comment_545250

## Stephen Cobeldick (view profile)

Direct link to this comment:https://de.mathworks.com/matlabcentral/answers/388054-if-a-b#comment_545275

## Skander Marouani (view profile)

Direct link to this comment:https://de.mathworks.com/matlabcentral/answers/388054-if-a-b#comment_545410

## Stephen Cobeldick (view profile)

Direct link to this comment:https://de.mathworks.com/matlabcentral/answers/388054-if-a-b#comment_545413

## Guillaume (view profile)

Direct link to this comment:https://de.mathworks.com/matlabcentral/answers/388054-if-a-b#comment_545416

Sign in to comment.