How to check the variables are equal or not?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Athul C P
le 25 Juin 2018
Réponse apportée : Stephen23
le 25 Juin 2018
if a=rt && b=rt
h=h+1;
elseif a~=rt && b=rt
f=f+1;
elseif a=rt && b~=rt
m=m+1;
elseif a~=rt && b~=rt
c=c+1;
end
Is this correct or I wanted to use double equal to '==' to check it
0 commentaires
Réponse acceptée
Stephen23
le 25 Juin 2018
You have to use
==
or
isequal
or
strcmp
or
ismember
or any other function that compares variables. = is only for allocation.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Entering Commands dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!