Path: news.mathworks.com!not-for-mail From: "John D'Errico" <woodchips@rochester.rr.com> Newsgroups: comp.soft-sys.matlab Subject: Re: how to calculate area of interpolated surface Date: Thu, 5 Mar 2009 22:23:02 +0000 (UTC) Organization: John D'Errico (1-3LEW5R) Lines: 33 Message-ID: <gopjc6$4i0$1@fred.mathworks.com> References: <gom2b9$m0n$1@fred.mathworks.com> <gom6nt$8m1$1@fred.mathworks.com> <gop9sd$3ib$1@fred.mathworks.com> Reply-To: "John D'Errico" <woodchips@rochester.rr.com> NNTP-Posting-Host: webapp-05-blr.mathworks.com Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1236291782 4672 172.30.248.35 (5 Mar 2009 22:23:02 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Thu, 5 Mar 2009 22:23:02 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 869215 Xref: news.mathworks.com comp.soft-sys.matlab:522863 "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gop9sd$3ib$1@fred.mathworks.com>... > "John D'Errico" <woodchips@rochester.rr.com> wrote in message <gom6nt$8m1$1@fred.mathworks.com>... > > ....... > > trapz(sum(dy*sqrt(1 + diff(F,[],2).^2),2),1)*dx > > ans = 1101.9 > > ....... > > John > > Note to John: I see you have also done a surface calculation above but I think that gets an answer that is too small. Shouldn't it be changed to something like this: > > trapz(sum(dy*sqrt(1 + diff(F,[],1).^2 + diff(F,[],2).^2),2),1)*dx Not quite, though I was sloppy. Best is probably this: [X,Y] = meshgrid(0:.1:1,0:.2:3); dx = 0.1; dy = 0.2; [Fx,Fy] = gradient(F,dx,dy); trapz(trapz(sqrt(1+Fx.^2 + Fy.^2)))*dx*dy ans = 46.689 Which correctly integrates the area, using gradient to compute the partials. This generates a surface area that is quite consistent with an area computed from the sum of the triangulated area as 46.811. I don't know how to solve the problem as posed by the OP, since we still don't know what he has. John