How to extract values within a circular region from a griddata?
Show older comments
I have a 2d matrix (100 x 100 size) obtained from the piece of code is as follows:
N = 100;
xv = linspace(min(CoordsX), max(CoordsX), N);
yv = linspace(min(CoordsY), max(CoordsY), N);
[X,Y] = ndgrid(xv, yv);
Data = griddata(CoordsX, CoordsY, Field, X, Y);
figure()
surf(X, Y, Data) % This make a surface plot of Data.
'Data' outputs a 100 x 100 matrix and then I plot a surface plot as it is in the code. Here I want to select a region with in a circle centered at xc, yc and radius 'r'. Then make another surface plot. How can I extract the vlaues from 'Data' those are within a circular region or radius 'r'?
Thank you
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!