what is the difference between = and ==?

33 ビュー (過去 30 日間)
j90889088
j90889088 2018 年 2 月 20 日
編集済み: James Tursa 2018 年 2 月 21 日
what is the difference between = and == in coding?

回答 (1 件)

James Tursa
James Tursa 2018 年 2 月 21 日
編集済み: James Tursa 2018 年 2 月 21 日
= is used for an assignment
== is the element-wise equality comparison operator
A = B; % Assigns the value of B to the variable A
A == B % The result of comparing the elements of A to B for equality

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by