How can I draw surf (semi-surf) for non square X-Y base plane?

1 次查看(过去 30 天)
..
I have assembled some nodes in X-Y plane as shown below.So I have a pair for each node [x y] which I assemble them in two matrices:
X=[x(1) x(2) x(3) ... x(537)]
X=[y(1) y(2) y(3) ... y(537)]
x(i) and y(i) stands for each node which is numbered in the figure shown above. I have calculated value like W fore each node.
I want draw continues surfaces which show me changes with help of pairs [x(i) y(i) W(i)]. How can I do it, because I can not use normal MATLAB surf order (My nodes are scattered in a similarly triangular form.)
As you see free spaces which don't have any nodes within in the figure should not be interpolated and shown on the final surface. Is there any way in MATLAB for such a non Square X-Y plane?

采纳的回答

Walter Roberson
Walter Roberson 2014-1-23
If you use TriScatteredInterp or the newer GriddedInterpolant, feeding in your (x,y,w) values, and interpolating into the full square grid using an interpolating routine which will not extrapolate, then the points outside the defined area will get filled with NaN. contour() treats NaN areas as holes.
If your points exactly match rectangular grid locations (the impression given by the diagram) then you can convert the (x,y) entries to I, J indices into a rectangular array that you initialized as NaN; write the w values there. sub2idx() might be useful in this pursuit. Then after contour(). If your conditions are right for this to work, this would be much faster than the interpolating method.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by