check the condition and assign discrete values

조회 수: 1 (최근 30일)
subha
subha 2013년 11월 4일
답변: Image Analyst 2013년 11월 4일
i have converted one dataset into four groups.say my datavalues are in between 0 to 1.
Then i seperated those values as <0.25 ,<0.5 ,<0.75,<1
now i want to assign 0.25 group as value 0, 0.5 group as 1 0.75 group as 2 1 group as 3
can anybody help in this?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 11월 4일
편집: Azzi Abdelmalek 2013년 11월 4일
x=rand(1,100)
[idx,idx]=histc(x,[0.25 0.5 0.75 1])
for k=1:4
groupe{k}=x(idx==k-1)
end
  댓글 수: 1
subha
subha 2013년 11월 4일
I used quartile method.Also i found probability for each quartile.Now i want to replace each quartile state to 0,1 ,2 ,3 respectively.I didnt use any cell array type
can you give me idea in this case
thanks

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

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 11월 4일
If you have the Image Processing Toolbox, you could use imquantize().

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by