Page MenuHomec4science

C2xyz_documentation.html
No OneTemporary

File Metadata

Created
Tue, May 21, 20:57

C2xyz_documentation.html

<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--
This HTML was auto-generated from MATLAB code.
To make changes, update the MATLAB code and republish this document.
--><title>C2xyz</title><meta name="generator" content="MATLAB 8.0"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2014-08-21"><meta name="DC.source" content="C2xyz_documentation.m"><style type="text/css">
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
html { min-height:100%; margin-bottom:1px; }
html body { height:100%; margin:0px; font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000; line-height:140%; background:#fff none; overflow-y:scroll; }
html body td { vertical-align:top; text-align:left; }
h1 { padding:0px; margin:0px 0px 25px; font-family:Arial, Helvetica, sans-serif; font-size:1.5em; color:#d55000; line-height:100%; font-weight:normal; }
h2 { padding:0px; margin:0px 0px 8px; font-family:Arial, Helvetica, sans-serif; font-size:1.2em; color:#000; font-weight:bold; line-height:140%; border-bottom:1px solid #d6d4d4; display:block; }
h3 { padding:0px; margin:0px 0px 5px; font-family:Arial, Helvetica, sans-serif; font-size:1.1em; color:#000; font-weight:bold; line-height:140%; }
a { color:#005fce; text-decoration:none; }
a:hover { color:#005fce; text-decoration:underline; }
a:visited { color:#004aa0; text-decoration:none; }
p { padding:0px; margin:0px 0px 20px; }
img { padding:0px; margin:0px 0px 20px; border:none; }
p img, pre img, tt img, li img { margin-bottom:0px; }
ul { padding:0px; margin:0px 0px 20px 23px; list-style:square; }
ul li { padding:0px; margin:0px 0px 7px 0px; }
ul li ul { padding:5px 0px 0px; margin:0px 0px 7px 23px; }
ul li ol li { list-style:decimal; }
ol { padding:0px; margin:0px 0px 20px 0px; list-style:decimal; }
ol li { padding:0px; margin:0px 0px 7px 23px; list-style-type:decimal; }
ol li ol { padding:5px 0px 0px; margin:0px 0px 7px 0px; }
ol li ol li { list-style-type:lower-alpha; }
ol li ul { padding-top:7px; }
ol li ul li { list-style:square; }
.content { font-size:1.2em; line-height:140%; padding: 20px; }
pre, tt, code { font-size:12px; }
pre { margin:0px 0px 20px; }
pre.error { color:red; }
pre.codeinput { padding:10px; border:1px solid #d3d3d3; background:#f7f7f7; }
pre.codeoutput { padding:10px 11px; margin:0px 0px 20px; color:#4c4c4c; }
@media print { pre.codeinput, pre.codeoutput { word-wrap:break-word; width:100%; } }
span.keyword { color:#0000FF }
span.comment { color:#228B22 }
span.string { color:#A020F0 }
span.untermstring { color:#B20000 }
span.syscmd { color:#B28C00 }
.footer { width:auto; padding:10px 0px; margin:25px 0px 0px; border-top:1px dotted #878787; font-size:0.8em; line-height:140%; font-style:italic; color:#878787; text-align:left; float:none; }
.footer p { margin:0px; }
.footer a { color:#878787; }
.footer a:hover { color:#878787; text-decoration:underline; }
.footer a:visited { color:#878787; }
table th { padding:7px 5px; text-align:left; vertical-align:middle; border: 1px solid #d6d4d4; font-weight:bold; }
table td { padding:7px 5px; text-align:left; vertical-align:top; border:1px solid #d6d4d4; }
</style></head><body><div class="content"><h1><tt>C2xyz</tt></h1><!--introduction--><p>C2XYZ returns the x and y coordinates of contours in a contour matrix and their corresponding z values. C is the contour matrix given by the contour function.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Syntax</a></li><li><a href="#2">Description</a></li><li><a href="#3">Example</a></li><li><a href="#6">Author Info</a></li></ul></div><h2>Syntax<a name="1"></a></h2><pre>[x,y] = C2xyz(C)
[x,y,z] = C2xyz(C)</pre><h2>Description<a name="2"></a></h2><p><tt>[x,y] = C2xyz(C)</tt> returns <tt>x</tt> and <tt>y</tt> cell arrays of coordinates of contours in a contour matrix <tt>C</tt>.</p><p><tt>[x,y,z] = C2xyz(C)</tt> also returns corresponding <tt>z</tt> values as double.</p><h2>Example<a name="3"></a></h2><p>Given a contour plot, you want to know the (x,y) coordinates of the contours, as well as the z value corresponding to each contour line.</p><pre class="codeinput">C = contour(peaks);
[x,y,z] = C2xyz(C);
</pre><img vspace="5" hspace="5" src="C2xyz_documentation_01.png" alt=""> <p>This returns 1 x numberOfContourLines cells of x values and y values, and their corresponding z values are given in a 1 x numberOfContourLines array. Let's pick out all the x, y locations where z = 0, and make that contour line a heavy black line:</p><pre class="codeinput">hold <span class="string">on</span>; <span class="comment">% Allows plotting atop the preexisting peaks plot.</span>
<span class="keyword">for</span> n = find(z==0); <span class="comment">% only loop through the z = 0 values.</span>
plot(x{n},y{n},<span class="string">'k'</span>,<span class="string">'linewidth'</span>,2)
<span class="keyword">end</span>
</pre><img vspace="5" hspace="5" src="C2xyz_documentation_02.png" alt=""> <p>And let's make all the z = -2 lines red and dotted:</p><pre class="codeinput"><span class="keyword">for</span> n = find(z==-2) <span class="comment">% now loop through the z = -2 values.</span>
plot(x{n},y{n},<span class="string">'r:'</span>,<span class="string">'linewidth'</span>,2)
<span class="keyword">end</span>
</pre><img vspace="5" hspace="5" src="C2xyz_documentation_03.png" alt=""> <h2>Author Info<a name="6"></a></h2><p>Created by Chad Greene, of the University of Texas Institute for Geophysics, August 2013. Updated August 2014.</p><p class="footer"><br><a href="http://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2012b</a><br></p></div><!--
##### SOURCE BEGIN #####
%% |C2xyz|
% C2XYZ returns the x and y coordinates of contours in a contour
% matrix and their corresponding z values. C is the contour matrix given by
% the contour function.
%
%% Syntax
%
% [x,y] = C2xyz(C)
% [x,y,z] = C2xyz(C)
%
%% Description
%
% |[x,y] = C2xyz(C)| returns |x| and |y| cell arrays of coordinates of contours in a contour
% matrix |C|.
%
% |[x,y,z] = C2xyz(C)| also returns corresponding |z| values as double.
%
%
%% Example
% Given a contour plot, you want to know the (x,y) coordinates of the contours,
% as well as the z value corresponding to each contour line.
C = contour(peaks);
[x,y,z] = C2xyz(C);
%%
% This returns 1 x numberOfContourLines cells of x values and y values, and
% their corresponding z values are given in a 1 x numberOfContourLines
% array. Let's pick out all the x, y locations where z = 0, and make that
% contour line a heavy black line:
hold on; % Allows plotting atop the preexisting peaks plot.
for n = find(z==0); % only loop through the z = 0 values.
plot(x{n},y{n},'k','linewidth',2)
end
%%
% And let's make all the z = -2 lines red and dotted:
for n = find(z==-2) % now loop through the z = -2 values.
plot(x{n},y{n},'r:','linewidth',2)
end
%% Author Info
% Created by Chad Greene, of the University of Texas Institute
% for Geophysics, August 2013. Updated August 2014.
##### SOURCE END #####
--></body></html>

Event Timeline