What does [n==0] means?
20 ビュー (過去 30 日間)
古いコメントを表示
Command n==0 and n==N
0 件のコメント
回答 (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!