MATLAB Answers

0

Second-Order Difference

Asked by Bruno Bertini on 23 Sep 2011
How can I find the Second-Order Difference signals in diagonal and minor diagonal of a matrix? The matrix is an image. For the horizontal and vertical I suppose this:
Dh = diff(image, 2);
Dv = diff(Image, 2 ,2);
Thanks!

  0 Comments

Sign in to comment.

1 Answer

bym
Answer by bym
on 24 Sep 2011

m = magic(4)
Dd = diff(diag(m),2) %diagonal
Dm = diff(diag(rot90(m)),2) %minor diagonal

  2 Comments

Bruno Bertini on 24 Sep 2011
Thank you very much!
Dh and Dv are correct?
I have to use the Second-Order Difference signals for an image.
bym
on 24 Sep 2011
Dh and Dv look correct. I have edited Dm to add the 2 ;)

Sign in to comment.