Effacer les filtres
Effacer les filtres

why the answer is coming as matrix and not a single number?

1 vue (au cours des 30 derniers jours)
haya yousuf
haya yousuf le 1 Juil 2016
Commenté : haya yousuf le 1 Juil 2016
I'm trying to find an answer of an mathematics operation to find a difference in two different black and white images, and the answer is coming as an matrix and i only need a single value.... what can i do? and how i can take two values for different conditions (equal pr not equal) if the answer is coming as matrix with different number of ones at each time?
  7 commentaires
haya yousuf
haya yousuf le 1 Juil 2016
i mean for example (A==B)=0, the answer is not a matrix
haya yousuf
haya yousuf le 1 Juil 2016
it worked with (isequal). Thank You:)

Connectez-vous pour commenter.

Réponses (1)

dpb
dpb le 1 Juil 2016
" and how i can take two values for different conditions (equal pr not equal) if the answer is coming as matrix ...?"
Well, the short answer is
truefalse=all(yourDifferenceArray); % only a single pixel is noted as a difference
truefalse=any(yourDifferenceArray); % takes every pixel to be different for TRUE
Or, of course, you could have some threshold of how many must be different to count by
truefalse=sum(yourDifferenceArray)<ThresholdNumber;
This assumes the difference is the plain subtraction so '==' returns 1 (TRUE) for locations that are the same.

Catégories

En savoir plus sur Creating and Concatenating Matrices 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!

Translated by