what is the difference between = and ==?

36 visualizzazioni (ultimi 30 giorni)
j90889088
j90889088 il 20 Feb 2018
Modificato: James Tursa il 21 Feb 2018
what is the difference between = and == in coding?

Risposte (1)

James Tursa
James Tursa il 21 Feb 2018
Modificato: James Tursa il 21 Feb 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

Categorie

Scopri di più su MATLAB Report Generator in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by