what is the difference between = and ==?
24 views (last 30 days)
Show older comments
what is the difference between = and == in coding?
0 Comments
Answers (1)
James Tursa
on 21 Feb 2018
Edited: James Tursa
on 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
0 Comments
See Also
Categories
Find more on MATLAB Report Generator in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!