How to filter out annular data from square matrix

2 次查看(过去 30 天)
Have a square matrix...501 by 501...Z=501×501
Need to filter out an annular data 20 to 150 centered at (251,251)

采纳的回答

Image Analyst
Image Analyst 2018-7-7
See the FAQ for creating a circle:
Then to get row and column indexes for your matrix, simply round, making sure that x is the second dimension, not the first because arrays are indexes as array(y, x) NOT array(x,y)
rows = round(y);
columns = round(x);
for k = 1 : length(rows)
Z(rows(k), columns(k)) = 0; % Filter to have whatever value you want them to have.
end
  3 个评论
Image Analyst
Image Analyst 2018-7-8
Looks fine to me
Probably a rendering issue. Look at the opengl() function and try some different things.

请先登录,再进行评论。

更多回答(1 个)

Bhowmik.U
Bhowmik.U 2018-7-7
Thanks for the suggestion..however I tried on similar lines but that yielded concentric boxes of data..rather than circles...

类别

Help CenterFile Exchange 中查找有关 Formatting and Annotation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by