Horizontal First Differencer on a Matrix

조회 수: 7 (최근 30일)
Sarah Maas
Sarah Maas 2021년 4월 18일
댓글: Sarah Maas 2021년 4월 18일
I have a matrix M and I need to implement a first differencer along the horizontal dimension as follows such that the value of each element is replaced by:
y[n, m] = x[n, m] x[n, m 1]
Where n and m be the independent variables (integer indices) indexing the matrix elements along the vertical and horizontal dimensions, respectively.

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2021년 4월 18일
Have a look on the help and documentation to diff. For this case use:
y = diff(x,[],2);
% or explicitly 1st difference:
y = diff(x,1,2);
% or manually:
y = x(:,2:end) - y(:,1:end-1);
HTH
  댓글 수: 1
Sarah Maas
Sarah Maas 2021년 4월 18일
Thank you. Can you also tell me how i can derive the frequency response of the above?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by