How can I draw surf (semi-surf) for non square X-Y base plane?
2 ビュー (過去 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?
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!