how to implement these equations in Matlab?
1 次查看(过去 30 天)
显示 更早的评论
I have the following equations
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/369538/image.jpeg)
where
and
represent the first-order derivative of matrix I . I tried to implement these equations in matlab using the following lines:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/369541/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/369544/image.jpeg)
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
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!