Histogram of Gradient Matrix
1 view (last 30 days)
Show older comments
Given a Matrix for example:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641590/image.png)
I need two Compuation Matrix such that
Gx = ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641595/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641595/image.png)
Gy = ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641600/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641600/image.png)
I am trying using gradient but not getting the exact results.
I also need to calculate the Magnitude of Gx and Gy such that my final matrix results as:
Resultant Matrix :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641605/image.jpeg)
Also need to caluclate the Angle of Gx and Gy (arctan(Gy/Gx)) degree.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641610/image.png)
All element values should be rounded off in all the matrix.
I need a general code which do not depend(size of input matrix) on matrix rows and coloumns of the given input matrix.
Please help with MATLAB Code
1 Comment
David Hill
on 3 Jun 2021
What is the multivariate equation used to generation your given matrix? You can't generate the gradients without knowing the equation or x/y streams.
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!