what is the difference between = and ==?

33 vues (au cours des 30 derniers jours)
j90889088
j90889088 le 20 Fév 2018
Modifié(e) : James Tursa le 21 Fév 2018
what is the difference between = and == in coding?

Réponses (1)

James Tursa
James Tursa le 21 Fév 2018
Modifié(e) : James Tursa le 21 Fév 2018
= 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

Catégories

En savoir plus sur MATLAB Report Generator dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by