<html lang="en"> <head> <title>Three-dimensional Function Plotting - GNU Octave</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="GNU Octave"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Three_002dDimensional-Plots.html#Three_002dDimensional-Plots" title="Three-Dimensional Plots"> <link rel="prev" href="Aspect-Ratio.html#Aspect-Ratio" title="Aspect Ratio"> <link rel="next" href="Three_002ddimensional-Geometric-Shapes.html#Three_002ddimensional-Geometric-Shapes" title="Three-dimensional Geometric Shapes"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Three-dimensional-Function-Plotting"></a> <a name="Three_002ddimensional-Function-Plotting"></a> <p> Next: <a rel="next" accesskey="n" href="Three_002ddimensional-Geometric-Shapes.html#Three_002ddimensional-Geometric-Shapes">Three-dimensional Geometric Shapes</a>, Previous: <a rel="previous" accesskey="p" href="Aspect-Ratio.html#Aspect-Ratio">Aspect Ratio</a>, Up: <a rel="up" accesskey="u" href="Three_002dDimensional-Plots.html#Three_002dDimensional-Plots">Three-Dimensional Plots</a> <hr> </div> <h5 class="subsubsection">15.2.2.2 Three-dimensional Function Plotting</h5> <!-- ezplot3 scripts/plot/ezplot3.m --> <p><a name="doc_002dezplot3"></a> <div class="defun"> — Function File: <b>ezplot3</b> (<var>fx, fy, fz</var>)<var><a name="index-ezplot3-1322"></a></var><br> — Function File: <b>ezplot3</b> (<var><small class="dots">...</small>, dom</var>)<var><a name="index-ezplot3-1323"></a></var><br> — Function File: <b>ezplot3</b> (<var><small class="dots">...</small>, n</var>)<var><a name="index-ezplot3-1324"></a></var><br> — Function File: <b>ezplot3</b> (<var>h, <small class="dots">...</small></var>)<var><a name="index-ezplot3-1325"></a></var><br> — Function File: <var>h</var> = <b>ezplot3</b> (<var><small class="dots">...</small></var>)<var><a name="index-ezplot3-1326"></a></var><br> <blockquote> <p>Plot a parametrically defined curve in three dimensions. <var>fx</var>, <var>fy</var>, and <var>fz</var> are strings, inline functions or function handles with one arguments defining the function. By default the plot is over the domain <code>-2*pi < </code><var>x</var><code> < 2*pi</code> with 60 points. <p>If <var>dom</var> is a two element vector, it represents the minimum and maximum value of <var>t</var>. <var>n</var> is a scalar defining the number of points to use. <p>The optional return value <var>h</var> is a graphics handle to the created plot. <pre class="example"> fx = @(t) cos (t); fy = @(t) sin (t); fz = @(t) t; ezplot3 (fx, fy, fz, [0, 10*pi], 100); </pre> <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dplot3.html#doc_002dplot3">plot3</a>, <a href="doc_002dezplot.html#doc_002dezplot">ezplot</a>, <a href="doc_002dezsurf.html#doc_002dezsurf">ezsurf</a>, <a href="doc_002dezmesh.html#doc_002dezmesh">ezmesh</a>. </p></blockquote></div> <!-- ezmesh scripts/plot/ezmesh.m --> <p><a name="doc_002dezmesh"></a> <div class="defun"> — Function File: <b>ezmesh</b> (<var>f</var>)<var><a name="index-ezmesh-1327"></a></var><br> — Function File: <b>ezmesh</b> (<var>fx, fy, fz</var>)<var><a name="index-ezmesh-1328"></a></var><br> — Function File: <b>ezmesh</b> (<var><small class="dots">...</small>, dom</var>)<var><a name="index-ezmesh-1329"></a></var><br> — Function File: <b>ezmesh</b> (<var><small class="dots">...</small>, n</var>)<var><a name="index-ezmesh-1330"></a></var><br> — Function File: <b>ezmesh</b> (<var><small class="dots">...</small>, 'circ'</var>)<var><a name="index-ezmesh-1331"></a></var><br> — Function File: <b>ezmesh</b> (<var>h, <small class="dots">...</small></var>)<var><a name="index-ezmesh-1332"></a></var><br> — Function File: <var>h</var> = <b>ezmesh</b> (<var><small class="dots">...</small></var>)<var><a name="index-ezmesh-1333"></a></var><br> <blockquote> <p>Plot the mesh defined by a function. <var>f</var> is a string, inline function or function handle with two arguments defining the function. By default the plot is over the domain <code>-2*pi < </code><var>x</var><code> < 2*pi</code> and <code>-2*pi < </code><var>y</var><code> < 2*pi</code> with 60 points in each dimension. <p>If <var>dom</var> is a two element vector, it represents the minimum and maximum value of both <var>x</var> and <var>y</var>. If <var>dom</var> is a four element vector, then the minimum and maximum value of <var>x</var> and <var>y</var> are specify separately. <p><var>n</var> is a scalar defining the number of points to use in each dimension. <p>If three functions are passed, then plot the parametrically defined function <code>[</code><var>fx</var><code> (</code><var>s</var><code>, </code><var>t</var><code>), </code><var>fy</var><code> (</code><var>s</var><code>, </code><var>t</var><code>), </code><var>fz</var><code> (</code><var>s</var><code>, </code><var>t</var><code>)]</code>. <p>If the argument 'circ' is given, then the function is plotted over a disk centered on the middle of the domain <var>dom</var>. <p>The optional return value <var>h</var> is a graphics handle to the created surface object. <pre class="example"> f = @(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2); ezmesh (f, [-3, 3]); </pre> <p>An example of a parametrically defined function is <pre class="example"> fx = @(s,t) cos (s) .* cos(t); fy = @(s,t) sin (s) .* cos(t); fz = @(s,t) sin(t); ezmesh (fx, fy, fz, [-pi, pi, -pi/2, pi/2], 20); </pre> <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dezplot.html#doc_002dezplot">ezplot</a>, <a href="doc_002dezmeshc.html#doc_002dezmeshc">ezmeshc</a>, <a href="doc_002dezsurf.html#doc_002dezsurf">ezsurf</a>, <a href="doc_002dezsurfc.html#doc_002dezsurfc">ezsurfc</a>. </p></blockquote></div> <!-- ezmeshc scripts/plot/ezmeshc.m --> <p><a name="doc_002dezmeshc"></a> <div class="defun"> — Function File: <b>ezmeshc</b> (<var>f</var>)<var><a name="index-ezmeshc-1334"></a></var><br> — Function File: <b>ezmeshc</b> (<var>fx, fy, fz</var>)<var><a name="index-ezmeshc-1335"></a></var><br> — Function File: <b>ezmeshc</b> (<var><small class="dots">...</small>, dom</var>)<var><a name="index-ezmeshc-1336"></a></var><br> — Function File: <b>ezmeshc</b> (<var><small class="dots">...</small>, n</var>)<var><a name="index-ezmeshc-1337"></a></var><br> — Function File: <b>ezmeshc</b> (<var><small class="dots">...</small>, 'circ'</var>)<var><a name="index-ezmeshc-1338"></a></var><br> — Function File: <b>ezmeshc</b> (<var>h, <small class="dots">...</small></var>)<var><a name="index-ezmeshc-1339"></a></var><br> — Function File: <var>h</var> = <b>ezmeshc</b> (<var><small class="dots">...</small></var>)<var><a name="index-ezmeshc-1340"></a></var><br> <blockquote> <p>Plot the mesh and contour lines defined by a function. <var>f</var> is a string, inline function or function handle with two arguments defining the function. By default the plot is over the domain <code>-2*pi < </code><var>x</var><code> < 2*pi</code> and <code>-2*pi < </code><var>y</var><code> < 2*pi</code> with 60 points in each dimension. <p>If <var>dom</var> is a two element vector, it represents the minimum and maximum value of both <var>x</var> and <var>y</var>. If <var>dom</var> is a four element vector, then the minimum and maximum value of <var>x</var> and <var>y</var> are specify separately. <p><var>n</var> is a scalar defining the number of points to use in each dimension. <p>If three functions are passed, then plot the parametrically defined function <code>[</code><var>fx</var><code> (</code><var>s</var><code>, </code><var>t</var><code>), </code><var>fy</var><code> (</code><var>s</var><code>, </code><var>t</var><code>), </code><var>fz</var><code> (</code><var>s</var><code>, </code><var>t</var><code>)]</code>. <p>If the argument 'circ' is given, then the function is plotted over a disk centered on the middle of the domain <var>dom</var>. <p>The optional return value <var>h</var> is a 2-element vector with a graphics handle for the created mesh plot and a second handle for the created contour plot. <pre class="example"> f = @(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2); ezmeshc (f, [-3, 3]); </pre> <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dezplot.html#doc_002dezplot">ezplot</a>, <a href="doc_002dezsurfc.html#doc_002dezsurfc">ezsurfc</a>, <a href="doc_002dezsurf.html#doc_002dezsurf">ezsurf</a>, <a href="doc_002dezmesh.html#doc_002dezmesh">ezmesh</a>. </p></blockquote></div> <!-- ezsurf scripts/plot/ezsurf.m --> <p><a name="doc_002dezsurf"></a> <div class="defun"> — Function File: <b>ezsurf</b> (<var>f</var>)<var><a name="index-ezsurf-1341"></a></var><br> — Function File: <b>ezsurf</b> (<var>fx, fy, fz</var>)<var><a name="index-ezsurf-1342"></a></var><br> — Function File: <b>ezsurf</b> (<var><small class="dots">...</small>, dom</var>)<var><a name="index-ezsurf-1343"></a></var><br> — Function File: <b>ezsurf</b> (<var><small class="dots">...</small>, n</var>)<var><a name="index-ezsurf-1344"></a></var><br> — Function File: <b>ezsurf</b> (<var><small class="dots">...</small>, 'circ'</var>)<var><a name="index-ezsurf-1345"></a></var><br> — Function File: <b>ezsurf</b> (<var>h, <small class="dots">...</small></var>)<var><a name="index-ezsurf-1346"></a></var><br> — Function File: <var>h</var> = <b>ezsurf</b> (<var><small class="dots">...</small></var>)<var><a name="index-ezsurf-1347"></a></var><br> <blockquote> <p>Plot the surface defined by a function. <var>f</var> is a string, inline function or function handle with two arguments defining the function. By default the plot is over the domain <code>-2*pi < </code><var>x</var><code> < 2*pi</code> and <code>-2*pi < </code><var>y</var><code> < 2*pi</code> with 60 points in each dimension. <p>If <var>dom</var> is a two element vector, it represents the minimum and maximum value of both <var>x</var> and <var>y</var>. If <var>dom</var> is a four element vector, then the minimum and maximum value of <var>x</var> and <var>y</var> are specify separately. <p><var>n</var> is a scalar defining the number of points to use in each dimension. <p>If three functions are passed, then plot the parametrically defined function <code>[</code><var>fx</var><code> (</code><var>s</var><code>, </code><var>t</var><code>), </code><var>fy</var><code> (</code><var>s</var><code>, </code><var>t</var><code>), </code><var>fz</var><code> (</code><var>s</var><code>, </code><var>t</var><code>)]</code>. <p>If the argument 'circ' is given, then the function is plotted over a disk centered on the middle of the domain <var>dom</var>. <p>The optional return value <var>h</var> is a graphics handle to the created surface object. <pre class="example"> f = @(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2); ezsurf (f, [-3, 3]); </pre> <p>An example of a parametrically defined function is <pre class="example"> fx = @(s,t) cos (s) .* cos (t); fy = @(s,t) sin (s) .* cos (t); fz = @(s,t) sin (t); ezsurf (fx, fy, fz, [-pi, pi, -pi/2, pi/2], 20); </pre> <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dezplot.html#doc_002dezplot">ezplot</a>, <a href="doc_002dezmesh.html#doc_002dezmesh">ezmesh</a>, <a href="doc_002dezsurfc.html#doc_002dezsurfc">ezsurfc</a>, <a href="doc_002dezmeshc.html#doc_002dezmeshc">ezmeshc</a>. </p></blockquote></div> <!-- ezsurfc scripts/plot/ezsurfc.m --> <p><a name="doc_002dezsurfc"></a> <div class="defun"> — Function File: <b>ezsurfc</b> (<var>f</var>)<var><a name="index-ezsurfc-1348"></a></var><br> — Function File: <b>ezsurfc</b> (<var>fx, fy, fz</var>)<var><a name="index-ezsurfc-1349"></a></var><br> — Function File: <b>ezsurfc</b> (<var><small class="dots">...</small>, dom</var>)<var><a name="index-ezsurfc-1350"></a></var><br> — Function File: <b>ezsurfc</b> (<var><small class="dots">...</small>, n</var>)<var><a name="index-ezsurfc-1351"></a></var><br> — Function File: <b>ezsurfc</b> (<var><small class="dots">...</small>, 'circ'</var>)<var><a name="index-ezsurfc-1352"></a></var><br> — Function File: <b>ezsurfc</b> (<var>h, <small class="dots">...</small></var>)<var><a name="index-ezsurfc-1353"></a></var><br> — Function File: <var>h</var> = <b>ezsurfc</b> (<var><small class="dots">...</small></var>)<var><a name="index-ezsurfc-1354"></a></var><br> <blockquote> <p>Plot the surface and contour lines defined by a function. <var>f</var> is a string, inline function or function handle with two arguments defining the function. By default the plot is over the domain <code>-2*pi < </code><var>x</var><code> < 2*pi</code> and <code>-2*pi < </code><var>y</var><code> < 2*pi</code> with 60 points in each dimension. <p>If <var>dom</var> is a two element vector, it represents the minimum and maximum value of both <var>x</var> and <var>y</var>. If <var>dom</var> is a four element vector, then the minimum and maximum value of <var>x</var> and <var>y</var> are specify separately. <p><var>n</var> is a scalar defining the number of points to use in each dimension. <p>If three functions are passed, then plot the parametrically defined function <code>[</code><var>fx</var><code> (</code><var>s</var><code>, </code><var>t</var><code>), </code><var>fy</var><code> (</code><var>s</var><code>, </code><var>t</var><code>), </code><var>fz</var><code> (</code><var>s</var><code>, </code><var>t</var><code>)]</code>. <p>If the argument 'circ' is given, then the function is plotted over a disk centered on the middle of the domain <var>dom</var>. <p>The optional return value <var>h</var> is a 2-element vector with a graphics for the created surface plot and a second handle for the created contour plot. <pre class="example"> f = @(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2); ezsurfc (f, [-3, 3]); </pre> <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dezplot.html#doc_002dezplot">ezplot</a>, <a href="doc_002dezmeshc.html#doc_002dezmeshc">ezmeshc</a>, <a href="doc_002dezsurf.html#doc_002dezsurf">ezsurf</a>, <a href="doc_002dezmesh.html#doc_002dezmesh">ezmesh</a>. </p></blockquote></div> </body></html>