what is the difference between = and ==?

35 次查看(过去 30 天)
j90889088
j90889088 2018-2-20
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 CenterFile Exchange 中查找有关 MATLAB Report Generator 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by