Boolen logic operations between integer numbers
조회 수: 5 (최근 30일)
이전 댓글 표시
Dear All,
I would like to know the reasons why this happens:
>> 3 && -4
ans =
1
Thanks in advance for your kindly support.
Best Regards,
Josh
댓글 수: 0
채택된 답변
Alexandra Harkai
2016년 11월 22일
편집: Alexandra Harkai
2016년 11월 22일
>> logical(3)
ans =
1
>> logical(-4)
ans =
1
댓글 수: 2
Guillaume
2016년 11월 22일
To add to this, only 0 is considered false by matlab (and many many other languages)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!