PATCH2GRID converts patch data into 2D gridded data. The resulting gridded data is calculated by taking the color value of the patch which occupies the largest area on a given grid point. The grid points are rectangular in shape and determined by the input grid vectors. The area that each patch occupies on a grid point is determined by the intersecting area (i.e. region of mutual overlap) between the rectangular grid point and the polygonal patch.
An optional "area weighted" method calculates the color value for a grid point by taking the weighted average of the patch colors whose weights are their intersecting area on the specific grid point.
Note that this function only produces 2D gridded data and assumes that the input patches are non-overlapping.
Cite As
Ivan Kostylev (2024). patch2grid (https://www.mathworks.com/matlabcentral/fileexchange/49173-patch2grid), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.