How to check the variables are equal or not?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Athul C P
el 25 de Jun. de 2018
Respondida: Stephen23
el 25 de Jun. de 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 comentarios
Respuesta aceptada
Stephen23
el 25 de Jun. de 2018
You have to use
==
or
isequal
or
strcmp
or
ismember
or any other function that compares variables. = is only for allocation.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Entering Commands en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!