How to do if else condition?

6 visualizzazioni (ultimi 30 giorni)
troy
troy il 11 Mag 2013
Hello,
Anyone have idea how to do if else condition?
I have pixel value of AA(i,j)<507x507 double> and BB(i,j)<512x512 double>. I want to do if value of AA(i,j) and BB(i,j) exceed 15 (>15) it will return to "Th" if not it will return to "Offset".
>>(i,j) is row and column for pixel value of an image.
I hope u understand what i need since i am beginner in Matlab and image processing.
  4 Commenti
troy
troy il 14 Mag 2013
Modificato: troy il 14 Mag 2013
actually i want to find threshold value and Th is Th(i,j). Same for Offset(i,j).
can I fix AA and BB, declare as:
AA(i,j)=(507:507); BB(i,j)=(507:507); like that?
thanks for the tutorial..
Walter Roberson
Walter Roberson il 14 Mag 2013
507:507 means the list of numbers starting from 507, incrementing by 1, until 507 is reached, and so would be equivalent to just 507 itself.
If you are trying to preallocate A, then
A = zeros(507, 507);

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 11 Mag 2013
if AA(i,j) > 15 & BB(i,j) > 15
... do something
else
... do something else
end

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by