Find local differences in a matrix

조회 수: 1 (최근 30일)
Anusha
Anusha 2013년 10월 21일
댓글: Anusha 2013년 10월 21일
This is an image palette containing RGB value
cmap=
0 0 0
0.5019 0 0
0.7529 0.7529 0.752
0 0.5019 0.5019
1 0 0
0.5019 0.5019 0.50196
0 0 0.50196
1 1 1
1 1 0
0.5019 0.5019 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
calculate this formula
D(cmap)=cmap(x,y)- cmap(x,y-1)
  댓글 수: 1
Anusha
Anusha 2013년 10월 21일
ADD part
After calculating D(cmap), Find
R=-(∑D(cmap))^2

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

채택된 답변

Andrei Bobrov
Andrei Bobrov 2013년 10월 21일
D = diff(cmap,1,2);

추가 답변 (1개)

David Sanchez
David Sanchez 2013년 10월 21일
For k=2:3
D = cmap(:,k) - cmap(:,k-1);
end

카테고리

Help CenterFile Exchange에서 Color and Styling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by