How to create a 3D surface from a matrix

I have a 2D array of heights and I want to build a 3D surface that will correspond the vertical height in pixels to the location on the surface based on the index of the height in the matrix. Is it possible to make the surface continuous as well?

 Accepted Answer

Use the surf function, or its friend, mesh (linked to in that documentation page).

2 Comments

Works perfectly, thanks for the tip!
As always, my pleasure!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!