Volume integration under surface fitting
이전 댓글 표시
I have 3 set's of data: x, y and z. Fitting a surface with fit command works well, but i can't find a way to correctly evaluate the volume beneath the surface and above xy plane. I'm getting NaN and warnings: Warning: Non-finite result. The integration was unsuccessful. Singularity likely.
The code i'm using is the following:
load('data.mat')
x=data(:,1);
y=data(:,2);
z=data(:,3);
fitobject = fit([x,y],z, 'cubicinterp');
image
plot(fitobject)
xlabel('Proj_X');
ylabel('Proj_Y');
zlabel('Intensity');
disp('volume')
a=0;
b=40.34;
c=1.634;
d=80.05;
volume_under_fit = quad2d(fitobject,a,b,c,d)
The data sets are in the following file:
Any help will be appreciated. Bruno
채택된 답변
추가 답변 (1개)
Shashank Prasanna
2013년 2월 16일
0 개 추천
Bruno, quad2d performs a double integral, which must only return the surface integral over the defined surface for the limits you specify.
If you want to compute the volume you should use triplequad:
Also your third file for download is not z.mat but data.mat, hence I couldn't try this out myself.
댓글 수: 1
카테고리
도움말 센터 및 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!