Generate surface from boundary points

7 次查看(过去 30 天)
Michael
Michael 2024-3-20
回答: Voss 2024-3-20
I have thickness measurements of a rectangular test specimen. These measurements can only be taken at the boundary, but I would like to get a rough visualization of what the thickness looks like across the span of the panel using the boundary point measurements. This is a general idea of what data I have now using somewhat random numbers:
Is there any way I can make a surface out of this?
Thanks!
  2 个评论
Dyuman Joshi
Dyuman Joshi 2024-3-20
The surface in between can be of any shape and size. You will have to specify more details or impose more restrictions to get a unique (or a set of unique) solution(s).
Michael
Michael 2024-3-20
What sorts of details and restrictions?

请先登录,再进行评论。

回答(1 个)

Voss
Voss 2024-3-20
x = linspace(0,3,6).';
y = linspace(0,1,6).';
nx = numel(x);
ny = numel(y);
zx = 0.134+0.007*rand(nx,2);
zy = [zx(1,1) zx(end,1); 0.134+0.007*rand(ny-2,2); zx(1,2) zx(end,2)];
figure
hold on
plot3(x,y(1)*ones(nx,1),zx(:,1))
plot3(x,y(end)*ones(nx,1),zx(:,2))
plot3(x(1)*ones(ny,1),y,zy(:,1))
plot3(x(end)*ones(ny,1),y,zy(:,2))
view(3)
[X,Y] = meshgrid(x,y);
XE = [X([1 end],:).'; X(2:end-1,[1 end])];
YE = [Y([1 end],:).'; Y(2:end-1,[1 end])];
ZE = [zx; zy(2:end-1,:)];
SI = scatteredInterpolant(XE(:),YE(:),ZE(:));
Z = SI(X,Y);
figure
surf(X,Y,Z,'FaceColor','interp','EdgeColor','none')

类别

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