<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258361</link>
    <title>MATLAB Central Newsreader - Calculating the volume under a non-gridded non-uniform surface</title>
    <description>Feed for thread: Calculating the volume under a non-gridded non-uniform surface</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 12 Aug 2009 18:43:19 -0400</pubDate>
      <title>Calculating the volume under a non-gridded non-uniform surface</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258361#672615</link>
      <author>Brian Roberts</author>
      <description>I have a dataset &quot;A&quot; (n by 3) of ordered triplets [x,y,z].  I want to calculate the volume between surface defined by &quot;A&quot; and the xy plane.  &quot;A&quot; has only positive values but is not uniformly spaced and not gridded.  &quot;A&quot; cannot be described by a simple function.  Any help?</description>
    </item>
    <item>
      <pubDate>Wed, 12 Aug 2009 19:13:20 -0400</pubDate>
      <title>Re: Calculating the volume under a non-gridded non-uniform surface</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258361#672623</link>
      <author>Doug Hull</author>
      <description>Brian,&lt;br&gt;
&lt;br&gt;
This is an excellent question.  Without knowing all of your constraints, I can lay out a general plan.  I will try to make this answer into a movie.  See my other movies here: (&lt;a href=&quot;http://blogs.mathworks.com/videos)&quot;&gt;http://blogs.mathworks.com/videos)&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
1.) Make a function (with interp2) that will give you the value at an arbitrary point See similar video about that: &lt;br&gt;
&lt;a href=&quot;http://blogs.mathworks.com/videos/2007/11/02/advanced-matlab-surface-plot-of-nonuniform-data/&quot;&gt;http://blogs.mathworks.com/videos/2007/11/02/advanced-matlab-surface-plot-of-nonuniform-data/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
2.)  Use quad2d to do the integration.&lt;br&gt;
&lt;br&gt;
I am working on this now, so will post more when finished.</description>
    </item>
    <item>
      <pubDate>Wed, 12 Aug 2009 19:32:18 -0400</pubDate>
      <title>Re: Calculating the volume under a non-gridded non-uniform surface</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258361#672628</link>
      <author>Doug Hull</author>
      <description>&quot;Doug Hull&quot; &amp;lt;hull@mathworks.SPAMPROOFcom&amp;gt; wrote in message &lt;br&gt;
&amp;gt; I am working on this now, so will post more when finished.&lt;br&gt;
&lt;br&gt;
I got it figured out:&lt;br&gt;
&lt;br&gt;
%%%%%%%%%%%&lt;br&gt;
n = 10;&lt;br&gt;
randOffset = 0.1;&lt;br&gt;
h = 1;&lt;br&gt;
&lt;br&gt;
x = rand(n);&lt;br&gt;
x(1:4) = [0 0 1 1]'; %force data points at corners so interpolation is valid in [0 1],[0 1]&lt;br&gt;
y = rand(n);&lt;br&gt;
y(1:4) = [0 1 0 1]';%force data points at corners so interpolation is valid in [0 1],[0 1]&lt;br&gt;
z = h + randOffset*rand(n) - randOffset/2; %make average height&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
plot3(x,y,z,'.')&lt;br&gt;
axis equal&lt;br&gt;
zlim([0 h + randOffset])&lt;br&gt;
&lt;br&gt;
interpZ = @(xi,yi) griddata(x,y,z,xi,yi) %set up interpolation&lt;br&gt;
&lt;br&gt;
interpZ(0.5,0.5) %test interpolation&lt;br&gt;
vol = quad2d(interpZ,0,1,0,1) %volume should be close to 1</description>
    </item>
    <item>
      <pubDate>Fri, 14 Aug 2009 17:27:19 -0400</pubDate>
      <title>Re: Calculating the volume under a non-gridded non-uniform surface</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258361#673287</link>
      <author>Luigi Giaccari</author>
      <description>It is even easier:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/24593&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/24593&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/23447&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/23447&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/22185&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/22185&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.advancedmcode.org/&quot;&gt;http://www.advancedmcode.org/&lt;/a&gt;</description>
    </item>
  </channel>
</rss>

