Help comparing two matrices
Mostra commenti meno recenti
so I need to compare two matrices but I need to set the values the final compared matrice will have... so for example if one value is higher than the other it should display 1; if it is lower -1 and finally if it is equal 0. I have been messing with this but cant figure it out I think I need a way to go over the two matrices comparing the two elements and but then how do I set those elements back into a matrice....? why is it so complicated!!!
well i need a function... sorry and thanks for the responses
1 Commento
Image Analyst
il 23 Dic 2014
You already asked this and got answers from Roger and Azzi, and you accepted one: here is your duplicate question, so why are you asking again??? For what it's worth, I like Roger's and Matt's solution of using sign() best.
Risposta accettata
Più risposte (1)
Matt J
il 23 Dic 2014
C=sign(A-B),
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!