stlwrite user a triangulation object has one its parameter.
Refer triangulation for making a triangulation object from the data set and provide it as a parameter for stlwrite function.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!