|
"Onno " <Onno.Groenheim@web.de> wrote in message
news:iui8i1$jma$1@newscl01ah.mathworks.com...
> I want to plot simulationdata from FEM-Simulation. Of course this data is
> scattered.
> I' ve got a matrix mx3 with the coodinates and a vector with the
> Information.
> At last i want to do a slice plot with a color interpolation.
> I used this code
> % Meshgrid for the plot
> m = 0;
> n = 60;
> s = 1;
> l = (n-m)/s+1;
> [x,y,z] = meshgrid(m:s:n,m:s:n,m:s:n);
> % TriScatteredInterp
> v=TriScatteredInterp(Centroids(:,1),Centroids(:,2),Centroids(:,3),...
> Values);
> % Interpolated Values
> V = v(x,y,z);
>
> Now my problem is, to sinp away the points which are outside my model, or
> to get boudaries for the plot.
It sounds like you want the convex hull for your set of points. If so, you
can construct a DelaunayTri and ask for its convexHull. You can then use
that DelaunayTri to construct a TriScatteredInterp to perform your
interpolation.
dt = DelaunayTri(Centroids(:,1),Centroids(:,2),Centroids(:,3));
theBoundary = convexHull(dt);
v = TriScatteredInterp(dt, Values);
interpolatedValues = v(x, y, z);
http://www.mathworks.com/help/techdoc/ref/delaunaytriclass.html
http://www.mathworks.com/help/techdoc/ref/delaunaytri.convexhull.html
--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
|