use of conditional statement

조회 수: 5 (최근 30일)
Sapam Jaya
Sapam Jaya 2014년 2월 7일
댓글: Sapam Jaya 2014년 2월 23일
I have a normalized image of size 160*190.i have to decompose it to low,middle and high inetnsity.the low bound is 0.4 and high bound is 0.7.which conditional statement can give the correct ans.

채택된 답변

Jos (10584)
Jos (10584) 2014년 2월 7일
Here is an example to obtain low intensities. It is often handy to keep the original format and set the elements you are not interested in to NaN or some other arbitrary value.
AllImage = rand(6,5) % smaller example
tf = AllImage < 0.4
lowImage = nan(size(AllImage))
lowImage(tf) = AllImage(tf)
ValuesOnly = AllImage(tf)
  댓글 수: 1
Sapam Jaya
Sapam Jaya 2014년 2월 23일
Here d values are in columns..i need to get as matrix so as display it.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

David Sanchez
David Sanchez 2014년 2월 7일
if (x<0.4)
...do anything
elseif (x>=0.4 | x<=0.7)
...do another thing
else % this is for x>0.7
...whatever
end
  댓글 수: 4
Sapam Jaya
Sapam Jaya 2014년 2월 23일
At d intensity of each pixel
Sapam Jaya
Sapam Jaya 2014년 2월 23일
Using if else returns a logical matrix.i want to get d intensity values

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by