<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239074</link>
    <title>MATLAB Central Newsreader - How do I plot the second derivative of the lower half of a circle?</title>
    <description>Feed for thread: How do I plot the second derivative of the lower half of a circle?</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>Tue, 11 Nov 2008 20:31:02 -0500</pubDate>
      <title>How do I plot the second derivative of the lower half of a circle?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239074#610364</link>
      <author>Gerry Puckett</author>
      <description>I am having difficulty understanding the syntax of defining a function that - from the point of view of MATLAB - is really an array of values of that function. &lt;br&gt;
&lt;br&gt;
So for example, &lt;br&gt;
&lt;br&gt;
% c(x) is the circle that passes through (x_l, y_l) and (x_r, y_r) &lt;br&gt;
% and has center (x_c, y_c) and radius R. &lt;br&gt;
&lt;br&gt;
zmin = x_c;&lt;br&gt;
zmax = x_c + R;&lt;br&gt;
&lt;br&gt;
dz = 1/1000;&lt;br&gt;
z = zmin : dz : zmax;&lt;br&gt;
&lt;br&gt;
c = y_c - sqrt( R^2 - (z - x_c).^2 );&lt;br&gt;
&lt;br&gt;
plot(z, c, 'r');&lt;br&gt;
&lt;br&gt;
produces the plot of the portion of the circle that I want.  However, now I want to plot the second derivative of c(x) over the same interval and I've tried&lt;br&gt;
&lt;br&gt;
cpp = R*R / (sqrt( R^2 - (z - x_c).^2 )).^3;&lt;br&gt;
&lt;br&gt;
and a number of other expressions to no avail.  I apparently don't understand the syntax &quot;.^&quot; and a number of other things about  MATLAB.  (I'm an old hand at FORTRAN and a variety of other computer languages and it seems that I should be able to &lt;br&gt;
define a function &lt;br&gt;
&lt;br&gt;
function cpp(z) = R*R / (sqrt( R^2 - (z - x_c)^2 ))^3;&lt;br&gt;
&lt;br&gt;
and either implicitly or explicitly loop over the values of z and plot the pair (z, cpp(z)).  However, I haven't found the appropriate part of MATLAB help that shows me how to do this.&lt;br&gt;
&lt;br&gt;
I do have the symbolic toolbox, if that is the only way to accomplish what I want.  However, it seems logical that MATLAB must have a way to plot something as straight forward as , for example&lt;br&gt;
&lt;br&gt;
&amp;nbsp;1/ sqrt( R^2 - (z - x_c)^2 ))^3;&lt;br&gt;
&lt;br&gt;
Thanks for your help!</description>
    </item>
    <item>
      <pubDate>Tue, 11 Nov 2008 21:06:12 -0500</pubDate>
      <title>Re: How do I plot the second derivative of the lower half of a </title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239074#610367</link>
      <author>Richard Brown</author>
      <description>On Nov 12, 9:31=A0am, &quot;Gerry Puckett&quot; &amp;lt;egpuck...@ucdavis.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; I am having difficulty understanding the syntax of defining a function th=&lt;br&gt;
at - from the point of view of MATLAB - is really an array of values of tha=&lt;br&gt;
t function.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; So for example,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; % c(x) is the circle that passes through (x_l, y_l) and (x_r, y_r)&lt;br&gt;
&amp;gt; % and has center (x_c, y_c) and radius R.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; zmin =3D x_c;&lt;br&gt;
&amp;gt; zmax =3D x_c + R;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; dz =3D 1/1000;&lt;br&gt;
&amp;gt; z =3D zmin : dz : zmax;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; c =3D y_c - sqrt( R^2 - (z - x_c).^2 );&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; plot(z, c, 'r');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; produces the plot of the portion of the circle that I want. =A0However, n=&lt;br&gt;
ow I want to plot the second derivative of c(x) over the same interval and =&lt;br&gt;
I've tried&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; cpp =3D R*R / (sqrt( R^2 - (z - x_c).^2 )).^3;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; and a number of other expressions to no avail. =A0I apparently don't unde=&lt;br&gt;
rstand the syntax &quot;.^&quot; and a number of other things about =A0MATLAB. =A0(I'=&lt;br&gt;
m an old hand at FORTRAN and a variety of other computer languages and it s=&lt;br&gt;
eems that I should be able to&lt;br&gt;
&amp;gt; define a function&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; function cpp(z) =3D R*R / (sqrt( R^2 - (z - x_c)^2 ))^3;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; and either implicitly or explicitly loop over the values of z and plot th=&lt;br&gt;
e pair (z, cpp(z)). =A0However, I haven't found the appropriate part of MAT=&lt;br&gt;
LAB help that shows me how to do this.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I do have the symbolic toolbox, if that is the only way to accomplish wha=&lt;br&gt;
t I want. =A0However, it seems logical that MATLAB must have a way to plot =&lt;br&gt;
something as straight forward as , for example&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; =A01/ sqrt( R^2 - (z - x_c)^2 ))^3;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks for your help!&lt;br&gt;
&lt;br&gt;
Missing one more dot, should be dot-divide&lt;br&gt;
&lt;br&gt;
cpp =3D R*R ./ (sqrt( R^2 - (z - x_c).^2 )).^3;&lt;br&gt;
&lt;br&gt;
cheers,&lt;br&gt;
&lt;br&gt;
Richard&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^^^</description>
    </item>
  </channel>
</rss>

