필터 지우기
필터 지우기

how to implement these equations in Matlab?

조회 수: 1 (최근 30일)
ghada sandoub
ghada sandoub 2020년 10월 1일
편집: VBBV 2020년 10월 2일
I have the following equations
where and represent the first-order derivative of matrix I . I tried to implement these equations in matlab using the following lines:
fx = diff(I,1,2);
fx = padarray(fx, [0 1 0], 'post');
fy = diff(I,1,1);
fy = padarray(fy, [1 0 0], 'post');
Gx = -log10(fx);
Gy = -log10(fy);
however, the value of Gx and Gy are complex numbers which means that these equations don't implemented correctely. does anyone know how to implement these equations correctely in matlab? any help will be appreciated.
  댓글 수: 5
John D'Errico
John D'Errico 2020년 10월 2일
natural log vs log10 is irrelevant. If one gives complex, than so will the other.
The log of a negative number is complex. Taken to ANY base.
VBBV
VBBV 2020년 10월 2일
편집: VBBV 2020년 10월 2일
Check if fx and fy Is producing negative values. Also verify the initial conidtions for generating I matrix used as input to diff function

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by