How can I compare the user input value in a given matrix.
Afficher commentaires plus anciens
b=[ 10 32 54 76 -25
20 60 100 140 -51
45 135 -135 -45 59]
b1=input(' b1= ');
b2=input('b2= ');
b3=input('b3= ');
b4=input('b4= ');
if (b1==b(1)||b(6)||b(11))&&(b2==b(2)||b(7)||b(12))&&(b3==b(3)||b(8)||b(13))&&(b4==b(4)||b(9)||b(14))
disp('MATCH FOUND');
else
disp('MATCH NOT FOUND');
end
1 commentaire
jgg
le 9 Jan 2016
I'm pretty sure your issue is that your or conditions are not written properly. Write them as full conditions.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!