Find local differences in a matrix

2 次查看(过去 30 天)
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)

采纳的回答

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 中查找有关 Colormaps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by