| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
Create isosurfaces with the isosurface and patch commands.
This example creates isosurfaces in a volume generated by the flow M-file. Generate the volume data with the command
[x,y,z,v] = flow;
To select the isovalue, determine the range of values in the volume data.
min(v(:)) ans = -11.5417 max(v(:)) ans = 2.4832
Through exploration, you can select isovalues that reveal useful information about the data. Once selected, use the isovalue to create the isosurface:
Use isosurface to generate data that you can pass directly to patch.
Recalculate the surface normals from the gradient of the volume data to produce better lighting characteristics (isonormals).
Set the patch FaceColor to red and the EdgeColor to none to produce a smoothly lit surface.
Adjust the view and add lighting (daspect, view, camlight, lighting).
hpatch = patch(isosurface(x,y,z,v,0)); isonormals(x,y,z,v,hpatch) set(hpatch,'FaceColor','red','EdgeColor','none') daspect([1,4,4]) view([-65,20]) axis tight camlight left; set(gcf,'Renderer','zbuffer'); lighting phong

![]() | Exploring Volumes with Slice Planes | Isocaps Add Context to Visualizations | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |