답변 (2개)

James Tursa
James Tursa 2023년 5월 4일
편집: James Tursa 2023년 5월 4일

0 개 추천

Try it out and see:
n = 3;
N = 3;
n == 0
ans = logical
0
n == N
ans = logical
1
n = randi(4,1,10) - 1
n = 1×10
2 1 1 2 3 1 0 1 0 1
n == 0
ans = 1×10 logical array
0 0 0 0 0 0 1 0 1 0
n == N
ans = 1×10 logical array
0 0 0 0 1 0 0 0 0 0
Returns logical true/false where values do or don't match.
Walter Roberson
Walter Roberson 2023년 5월 4일

0 개 추천

n==0
normally compares every element of n to the value 0 and returns a logical array the same size as n indicating whether the corresponding object element was 0.
However if n happens to be a symbolic expression then for each element of n the results may be symtrue or symfalse or a symbolic comparison to be decided later.
If n is not numeric or logical or character or symbolic then the individual class defines the meaning of the == operation.

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

질문:

2023년 5월 4일

답변:

2023년 5월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by