Find local differences in a matrix

2 Ansichten (letzte 30 Tage)
Anusha
Anusha am 21 Okt. 2013
Kommentiert: Anusha am 21 Okt. 2013
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 Kommentar
Anusha
Anusha am 21 Okt. 2013
ADD part
After calculating D(cmap), Find
R=-(∑D(cmap))^2

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 21 Okt. 2013
D = diff(cmap,1,2);

Weitere Antworten (1)

David Sanchez
David Sanchez am 21 Okt. 2013
For k=2:3
D = cmap(:,k) - cmap(:,k-1);
end

Kategorien

Mehr zu Colormaps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by