approximate derivative of array
Show older comments
Hey there, I have a profile of an edge region within an image that is in edge:(<1x29 uint32>). I have a second array of same type and length, that I want to store an approximate derivative in by subtracting each element with the following one (and disregarding the last element). The array produced does somehow only contain ones and twos and definately not what I am looking for. This might be easy, but I can't find it.
The loop I used was:
for i = 1:(xwidth)
lsf(i) = abs(edge((i+1)) - edge(i));
end
lsf(xwidth+1) = 0;
xwidth is the actual length minus one to not fall off the edge at the end. The iteration works so its not about the idizes.
Yurie
Accepted Answer
More Answers (0)
Categories
Find more on Graph and Network Algorithms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!