Generate surface from boundary points
조회 수: 7 (최근 30일)
이전 댓글 표시
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
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).
답변 (1개)
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')
댓글 수: 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!