What does [n==0] means?
15 次查看(过去 30 天)
显示 更早的评论
回答(2 个)
James Tursa
2023-5-4
编辑:James Tursa
2023-5-4
Try it out and see:
n = 3;
N = 3;
n == 0
n == N
n = randi(4,1,10) - 1
n == 0
n == N
Returns logical true/false where values do or don't match.
0 个评论
Walter Roberson
2023-5-4
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!