3d plot-surf
Show older comments
Dear all,
I have a 2d matrix (2358*2) which corresponds to the points of a 2d grid (A: x-y data). These points do not define a rectangle. A second matrix (B: 2358*1) represents a specific variable corresponding to each of the gird points. What I want to show is the a 3D representation of these two matrices; so that I can get the surface of B over the grid points (A). The function 'surface' may work but I could not apply it as I do not have exactly a fully rectangle grid.
What I need to get as the end needs to look like a 3d topography.
Your great help would be appreciated, many thanks.
Reyhaneh
Accepted Answer
More Answers (1)
Image Analyst
on 31 Dec 2015
1 vote
If your x,y locations are not complete (some coordinates are missing), or not in a perfect grid, then you'll have to get them into a grid using scatteredInterpolant(). After you use scatteredInterpolant(), then you'll have a perfect rectangular gridded image and then you can use surf to map the value into a height above a plane, or you can use imshow() to display it as an image.
Categories
Find more on Lighting, Transparency, and Shading 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!